In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

blazingFire

Get Adobe Flash player
by 0xABCDEF 08 Feb 2010
/**
 * Copyright 0xABCDEF ( http://wonderfl.net/user/0xABCDEF )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9Cub
 */

package {
	import flash.display.Shape;
    import flash.display.Sprite;
    import flash.events.Event;
    [SWF(width=465,height=465,backgroundColor=0x000000,frameRate=60)]
    public class Fire extends Sprite {
        public function Fire() {
            var s:Shape = new Shape();
			stage.addChild(s);
			var a:Array = new Array();
			var i:int;
			var randx:Number;
			var randy:Number;
			function ef(e:Event):void {
				randx = Math.random()*50-25;
				randy = Math.random()*50-25;
				s.graphics.clear();
				a.push({x:stage.mouseX+randx,y:stage.mouseY+randy,r:Math.random()*30,a:Math.random()*0.5+0.5,c:Math.random()*0x77+0x88});
				a.push({x:stage.mouseX+randx,y:stage.mouseY+randy,r:Math.random()*30,a:Math.random()*0.5+0.5,c:Math.random()*0x77+0x88});
				for(i=0;i<a.length;i++){
					s.graphics.beginFill(a[i].c<<16,a[i].a);
					s.graphics.drawCircle(a[i].x,a[i].y,a[i].r);
					s.graphics.endFill();
					a[i].x += Math.random()*2-1;
					a[i].y -= 3;
					a[i].a -= 0.02;
					a[i].r -= 0.05;
					a[i].c -= 1;
					if(a[i].a<0){
						a.splice(i,1);
					}
				}
			}
			stage.addEventListener(Event.ENTER_FRAME, ef);
        }
    }
}