Flint Particle System Forum - How do I really kill all particles? Sat, 26 May 2012 06:49:14 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher How do I really kill all particles? http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1894#Comment_1894 http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1894#Comment_1894 Sat, 10 Mar 2012 10:56:32 +0000 MikeBedar
Here is my cleanup code (copied largely from this forum):


//Removal Code
emitter.removeEventListener( ParticleEvent.PARTICLE_DEAD, particle_death_event, false)
emitter.stop();

ParticleCreator2D(emitter.particleFactory).clearAllParticles();

renderer.removeEmitter( emitter );
emitter = null;

removeChild( renderer );
renderer = null;
//


//And here is my creation code:

var new_particle:Particle2D = ParticleCreator2D(emitter.particleFactory).createParticle() as Particle2D;

new_particle.image = new Bitmap(tile_bmd);
new_particle.x = source_rect.x
new_particle.y = source_rect.y

emitter.addParticle( new_particle, true )

//

Is there another step that I am missing? After calling the removal code all of the particles are still in memory(forever) and each time I run this process, while the particles ARE being reused, I am still using more memory each time around.

Any help would be appreciated.

Also, is there a way I could be making new particles directly from the BMD? I know there is the big factory function, but I need non-square bitmap particles. ]]>
How do I really kill all particles? http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1895#Comment_1895 http://flintparticles.org/forum/comments.php?DiscussionID=554&Focus=1895#Comment_1895 Sun, 18 Mar 2012 17:15:02 +0000 Richard
Also, are you cleaning up the bitmap data from the particle images? ]]>