Flint Particle System Forum - Fade and remove all particles Thu, 23 Jun 2011 16:34:48 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=143#Comment_143 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=143#Comment_143 Mon, 19 May 2008 16:32:35 +0100 bbigger
Thanks! ]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=144#Comment_144 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=144#Comment_144 Mon, 19 May 2008 16:55:55 +0100 Richard
When you're done, call dispose() on the emitter to clean up the particles neatly, and if you're using a BitmapRenderer or PixelRenderer, call dispose() on that too to free the memory used by the bitmapData object. ]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=149#Comment_149 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=149#Comment_149 Wed, 21 May 2008 13:36:36 +0100 robotz Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=151#Comment_151 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=151#Comment_151 Wed, 21 May 2008 18:22:48 +0100 ericr 1) Fade out the renderer.
2) Loop through your Emitter objects and call "emitter.dispose()" on each.
3) Call "renderer.dispose()" on your FullStagePixelRenderer (assuming the code you posted in another thread).

That should clean everything up for you. ]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=533#Comment_533 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=533#Comment_533 Thu, 20 Nov 2008 23:46:04 +0000 luka66_6
import flash.geom.Point;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.displayObjects.RadialDot;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;

var emitter:Emitter2D = new Emitter2D();

emitter.counter = new Blast( 2000 );

emitter.addInitializer( new ColorInit( 0xFFFF00FF, 0xFF00FFFF ) );
emitter.addInitializer( new Position( new DiscZone( new Point( 75, 17.5 ), 150 ) ) );

emitter.addAction( new Move() );

emitter.addAction( new GravityWell( 25, 75, 17.5 ) );

var renderer:PixelRenderer = new PixelRenderer( new Rectangle( 0, 0, 150, 35 ) );
renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.99,0 ] ) );

this.btn.addEventListener(MouseEvent.MOUSE_OVER, particleShow)

function particleShow(event:MouseEvent):void
{
renderer.addEmitter( emitter );
addChild( renderer );
emitter.start();
renderer.alpha = 1;
}

this.btn.addEventListener(MouseEvent.MOUSE_OUT, particleStop)

function particleStop(event:MouseEvent):void
{
renderer.addEventListener(Event.ENTER_FRAME, particleFade);
}

function particleFade(event:Event):void
{
renderer.alpha -= 0.1;
if(renderer.alpha <= 0.2)
{
removeEmitter( emitter );
}
}

if i add removeChild( renderer ); to my particleFade function i get an error: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()

like i said any help would be great i love this system and i really like to be able to give my buttons nice roll on and out with particles fade effects.

regards
Luka ]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=543#Comment_543 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=543#Comment_543 Sat, 22 Nov 2008 17:56:41 +0000 luka66_6
regards
Luka ]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=544#Comment_544 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=544#Comment_544 Sat, 22 Nov 2008 17:57:12 +0000 Richard
function particleFade(event:Event):void{
renderer.alpha -= 0.1;
if (renderer.alpha<=0.2)
{
emitter.stop();
renderer.removeEmitter( emitter );
renderer.removeEventListener(Event.ENTER_FRAME, particleFade);
removeChild( renderer );
}
}
]]>
Fade and remove all particles http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=545#Comment_545 http://flintparticles.org/forum/comments.php?DiscussionID=32&Focus=545#Comment_545 Sat, 22 Nov 2008 18:07:08 +0000 luka66_6