Flint Particle System Forum - Explode a dynamic symbol added to the stage Mon, 12 Dec 2011 04:45:18 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Explode a dynamic symbol added to the stage http://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1498#Comment_1498 http://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1498#Comment_1498 Mon, 03 Jan 2011 20:57:59 +0000 Tuskony
I just downloaded the libraries for this particle system and I must say the examples I have seen are REALLY impressive!!!!

What I am trying to do is explode a symbol that gets added to the stage dynamically.

I have "batteries" drop out of the sky on to the stage and if the user doesn't click on them fast enough I want them to explode. I managed to make this work if I used a jpeg but I want to use symbols so it jives with the rest of my code.

Here is what I have so far: (sorry it's probably butchered!)

//Rendering stuff for exploding decayed batteries
var emitter:Emitter2D = new Emitter2D();
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
var particles = Particle2DUtils.createParticle2DFromDisplayObject(this, renderer, emitter.particleFactory);
emitter.addExistingParticles( particles, true );

renderer.addEmitter( emitter );
addChild( renderer );
emitter.start();

This code is embedded in a method for the battery class that gets called when a timer event triggers telling the code that the battery has now decayed!

It gives me the follow error when the timer event is triggered:

"TypeError: Error #1034: Type Coercion failed: cannot convert org.flintparticles.twoD.particles::Particle2D@268e9031 to Array.
at Battery_mc/BatteryDecayed()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()"

Any help would be greatly appreciated! ]]>
Explode a dynamic symbol added to the stage http://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1500#Comment_1500 http://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1500#Comment_1500 Tue, 04 Jan 2011 04:09:53 +0000 ven
-ven ]]>