Flint Particle System Forum - How do I prevent particles fading once reached destination? 2011-12-11T23:46:43+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher How do I prevent particles fading once reached destination? http://flintparticles.org/forum/comments.php?DiscussionID=408&Focus=1398#Comment_1398 2010-10-06T16:02:16+01:00 2011-12-11T23:46:43+00:00 hectors http://flintparticles.org/forum/account.php?u=364 Hiya, I've looked through the examples and can't find how to do this. I'm adding a TweenToZone: _startEmitter.addAction(new TweenToZone(new BitmapDataZone(__myBitmapData))); This works great ...
_startEmitter.addAction(new TweenToZone(new BitmapDataZone(__myBitmapData)));

This works great but I want my particles not to disappear when they reach their destination.

What's the best way to do this?

Thanks :)]]>
How do I prevent particles fading once reached destination? http://flintparticles.org/forum/comments.php?DiscussionID=408&Focus=1402#Comment_1402 2010-10-09T16:16:32+01:00 2010-10-09T16:17:26+01:00 Richard http://flintparticles.org/forum/account.php?u=1 The tween is tied to the particle's lifetime. As a result, the particle dies when the tween ends. However, if you listen for the particle dead event, you can revive the particle and add it to a ...
However, if you listen for the particle dead event, you can revive the particle and add it to a different emitter which doesn't tween it (or kill it). Something like this

stableEmitter = new Emitter2D();
renderer.addEmitter( stableEmitter );
stableEmitter.start();

emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, reviveParticle );

function reviveParticle( event:ParticleEvent ):void
{
event.particle.revive();
stableEmitter.addExistingParticles( [ event.particle ], false );
}


You can see a more complete example of this in the Logo Tween example.]]>
How do I prevent particles fading once reached destination? http://flintparticles.org/forum/comments.php?DiscussionID=408&Focus=1464#Comment_1464 2010-12-09T21:15:40+00:00 2011-12-11T23:46:43+00:00 Bob vd Bibs http://flintparticles.org/forum/account.php?u=444 Hi Richard, i tried this but the particle still has an alpha of 0 so i cant see it. (or something else is wrong). Is there a way of getting more control over the lifecycle of the particle? How ...
i tried this but the particle still has an alpha of 0 so i cant see it. (or something else is wrong).
Is there a way of getting more control over the lifecycle of the particle? How can i prevent the particle from fading?

tnx]]>
How do I prevent particles fading once reached destination? http://flintparticles.org/forum/comments.php?DiscussionID=408&Focus=1484#Comment_1484 2010-12-20T07:46:02+00:00 2011-12-11T23:46:43+00:00 Richard http://flintparticles.org/forum/account.php?u=1 Set the particle's color when you revive it. The color is a 32bit value, with the first 8 bits (the first FF below) indicating the alpha. stableEmitter = new Emitter2D(); renderer.addEmitter( ...
stableEmitter = new Emitter2D();
renderer.addEmitter( stableEmitter );
stableEmitter.start();

emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, reviveParticle );

function reviveParticle( event:ParticleEvent ):void
{
event.particle.revive();
event.particle.color = 0xFFFFFFFF;
stableEmitter.addExistingParticles( [ event.particle ], false );
}
]]>