Flint Particle System Forum - Get the x/y of last particle when it dies? Sun, 26 Dec 2010 17:43:52 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Get the x/y of last particle when it dies? http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=872#Comment_872 http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=872#Comment_872 Fri, 24 Jul 2009 16:41:20 +0100 TackleMcClean My emitter listens for the ParticleEvent.PARTICLE_DEAD event.
From what I've gathered, the event is dispatched and first AFTER the event has been handled, the particle is removed.

However, in my event handler for the event, I try this:
trace(e.particle.image.x);
trace(e.particle.image.y);

Both return 0.

trace(e.particle.isDead);
returns true as well

So the particle is removed before the event is handled, or at least before the code in the event handler runs.

How would one go about to try and figure out the x/y after a particle dies? ]]>
Get the x/y of last particle when it dies? http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=890#Comment_890 http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=890#Comment_890 Sat, 08 Aug 2009 11:08:25 +0100 Richard particleDead event which caries information about the particle, including its location. ]]> Get the x/y of last particle when it dies? http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=948#Comment_948 http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=948#Comment_948 Mon, 02 Nov 2009 03:54:52 +0000 gordeaoux emitter.addEventListener(ParticleEvent.PARTICLE_DEAD, pDead);
function pDead(ef:ParticleEvent):void{
trace(ef.target.x)
}

I assume it's because the "target" refers to the Emitter2d object and not the particle. How do I figure out which particle has just died, or it's properties? Is particleDead different than ParticleEvent.PARTICLE_DEAD? ]]>
Get the x/y of last particle when it dies? http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=949#Comment_949 http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=949#Comment_949 Mon, 02 Nov 2009 04:59:20 +0000 gordeaoux
function pDead(ef:ParticleEvent):void{
trace(ef.particle.image.x)
}

emitter.addEventListener(ParticleEvent.PARTICLE_DEAD, pDead);
]]>
Get the x/y of last particle when it dies? http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=953#Comment_953 http://flintparticles.org/forum/comments.php?DiscussionID=243&Focus=953#Comment_953 Mon, 02 Nov 2009 08:45:43 +0000 Richard
function pDead(ef:ParticleEvent):void{
trace(ef.particle.x)
}
]]>