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: its snowy

Get Adobe Flash player
by tomohero 14 Feb 2009
// forked from hacker_9h3e713z's its snowy
// forked from hacker_9h3e713z's forked from: forked from: tes
// forked from hacker_9h3e713z's forked from: tes
// forked from hacker_9h3e713z's tes

package {
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.events.Event;
    
    public class FlashTest extends MovieClip
    {
        private var diameter:Number = 0;
        private var pCount:Number = 5;
        public function FlashTest() 
        {
            var bg:MovieClip = new MovieClip();
            bg.graphics.beginFill(0x000000);
            bg.graphics.drawRect(-150,-100,10,1000);
            addChild(bg);
	    addEventListener(Event.ENTER_FRAME,createParticles);
	}
		
        private function createParticles(evt:Event):void
        {
            var pointer:MovieClip = new MovieClip();
            drawCircle(pointer);
            pointer.x = Math.random()*500-150;
            pointer.y = -200;//-150-Math.random()*150;
            pointer.alpha = .2+Math.random()*.75
            pointer.wind = -1.5+Math.random()*(1.4*3);
            pointer.k = 1+Math.random()*2;
            //pointer.x = -150;
            //pointer.y = -150;
            //pointer.addEventListener(Event.ENTER_FRAME,particleMove);
            pointer.addEventListener(Event.ENTER_FRAME,snowFallDown);
            addChild(pointer);
        }

	private function drawCircle(mc:MovieClip):void
	{
                var d:Number = Math.random()*5;
		mc.graphics.lineStyle(0,0x333333,1);
                mc.graphics.beginFill(0xFFFFFF);
		mc.graphics.drawCircle(150,150,d/2);
	}
        private function particleMove(evt:Event):void
	{
                var diffX:Number = (mouseX-150)-evt.target.x;
                var diffY:Number = (mouseY-150)-evt.target.y;
                evt.target.x += diffX/6;
                evt.target.y += diffY/6;
                evt.target.alpha -= .05;
                if (evt.target.alpha<0)
                {
                    evt.target.parent.removeChild(evt.target);
                }
	}       
        private function snowFallDown(evt:Event):void
	{
                //var diffX:Number = (mouseX-150)-evt.target.x;
                //var diffY:Number = (mouseY-150)-evt.target.y;
                evt.target.x += evt.target.wind;
                evt.target.y += evt.target.k;
                //evt.target.alpha -= .05;
                if (evt.target.y>350)
                {
                    evt.target.parent.removeChild(evt.target);
                }
	}
    }
}