Flint Particle System Forum - Prevent Flint from "claiming" stage after removal.2011-12-12T02:15:53+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Prevent Flint from "claiming" stage after removal.http://flintparticles.org/forum/comments.php?DiscussionID=433&Focus=1473#Comment_14732010-12-14T18:06:13+00:002011-12-12T02:15:53+00:00venhttp://flintparticles.org/forum/account.php?u=447
Hi,
I'm working on a puzzle game, where each of the tiles is a movieclip. When matching tiles get removed an explosion (via Flint) is created. The problem I am having is that after the first ...
I'm working on a puzzle game, where each of the tiles is a movieclip. When matching tiles get removed an explosion (via Flint) is created. The problem I am having is that after the first explosion, all mouse events are going to Flint even though I have deleted the explosion object. Can someone offer some help/suggestions.
Here is how init the explosion object. explosions = new Flint( stage.width, stage.height ); addChild( explosions );
Later on when i need to create the explosions, I do: explosions.addEmitter( x, y, c, c );
When I am done with the explosions I call the following routine: explosions.removeEmitter(); removeChild( explosions ); explosions = null;
Here is the my Flint class ( I modified one of the examples from the website).
function removeEmitter() { //http://flintparticles.org/forum/comments.php?DiscussionID=203&page=1#Item_0
for ( var i:int = 0; i < emitters.length; i++ ) { // Stop the emitter emitters[i].stop(); // Clear all the cached particles ParticleCreator2D( emitters[i].particleFactory ).clearAllParticles(); // Remove references to the emitter renderer.removeEmitter( emitters[i]); emitters[i] = null; }
// Remove references to the renderer removeChild( renderer ); renderer = null; }
} }]]>
Prevent Flint from "claiming" stage after removal.http://flintparticles.org/forum/comments.php?DiscussionID=433&Focus=1474#Comment_14742010-12-14T18:41:43+00:002011-12-12T02:15:53+00:00venhttp://flintparticles.org/forum/account.php?u=447
Never mind, I found the problem. It seems that I was creating multiple instances of explosions, hence I was only removing once instance of explosion instead of the many that I was unknowingly ...
-ven]]>