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

forked from: blazingFire

Get Adobe Flash player
by undo 09 Feb 2010
/**
 * Copyright undo ( http://wonderfl.net/user/undo )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/3TMd
 */

// forked from HNAR's blazingFire
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 a:Array = new Array();
			var i:int;
			function ef(e:Event):void {
				for(i=0;i<2;i++)
				{
					var s:Sprite = new Sprite();
					s.alpha = Math.random()*0.5+0.5;
					s.graphics.beginFill((Math.random()*0xffffff)&0xff2222);
					var rnd:Number = Math.random()*20+10;
					s.graphics.drawCircle(0,0,rnd);
					s.graphics.endFill();
					s.blendMode = "add";
					stage.addChild(s);
					s.x = stage.mouseX + Math.random()*20-10;
					s.y = stage.mouseY + Math.random()*20-10;
					a.push(s);
				}
				for(i=0;i<a.length;i++){
					a[i].x += Math.random()*2-1;
					a[i].y -= 3;
					a[i].alpha -= 0.02;
					a[i].scaleX -= 0.02;
					a[i].scaleY -= 0.02;
					if(a[i].alpha<=0){
						stage.removeChild(a[i]);
						a.splice(i,1);
					}
				}
			}
			stage.addEventListener(Event.ENTER_FRAME, ef);
        }
    }
}