Flint Particle System Forum - Explode a dynamic symbol added to the stage2011-12-12T05:12:39+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Explode a dynamic symbol added to the stagehttp://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1498#Comment_14982011-01-03T20:57:59+00:002011-01-03T20:59:22+00:00Tuskonyhttp://flintparticles.org/forum/account.php?u=454
Hey,
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 ...
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 );
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 stagehttp://flintparticles.org/forum/comments.php?DiscussionID=439&Focus=1500#Comment_15002011-01-04T04:09:53+00:002011-12-12T05:12:39+00:00venhttp://flintparticles.org/forum/account.php?u=447
Check out my code in Show and Tell category, might help you. Also, one thing I find helpful when developing (if in CS3/CS4) is to Permit debugging so line #'s of where the offending error/warning ...
-ven]]>