Flint Particle System Forum - Image explosion with symbol on stage2010-12-25T19:13:47+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Image explosion with symbol on stagehttp://flintparticles.org/forum/comments.php?DiscussionID=155&Focus=624#Comment_6242009-01-14T23:32:59+00:002009-01-14T23:33:47+00:00speasleyhttp://flintparticles.org/forum/account.php?u=139
I'm banging my head against the wall over this. I have a symbol on stage that I want to explode, similar to the Explode Image example. My code breaks here:
var particles = ...
var particles = Particle2DUtils.createParticle2DFromDisplayObject(sprite,renderer,emitter.particleFactory); emitter.addInitializer(particles);
This results in:
TypeError: Error #1034: Type Coercion failed: cannot convert org.flintparticles.twoD.particles::Particle2D@37fc30e1 to org.flintparticles.common.initializers.Initializer. at classes::Main/doExplosion()
I can't seem to figure out how to make use of createParticle2DFromDisplayObject.
Thanks for your help.]]>
Image explosion with symbol on stagehttp://flintparticles.org/forum/comments.php?DiscussionID=155&Focus=626#Comment_6262009-01-15T08:03:45+00:002010-12-25T19:13:47+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
It your second line of code, you're trying to add the particle as an initializer - it's not an initializer, it's a particle. Try
var particle = ...
var particle = Particle2DUtils.createParticle2DFromDisplayObject(sprite,renderer,emitter.particleFactory); emitter.addExistingParticles( [particle] );
if you want to apply your emitter's initializers to the particle, change the second line of code to