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

flash on 2009-2-26

Get Adobe Flash player
by awef 26 Feb 2009
/**
 * Copyright awef ( http://wonderfl.net/user/awef )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/6vR9
 */

package
{
    import flash.display.*;
    import flash.events.*;
    
    public class main extends Sprite
    {
        private var obj:Array = new Array();
        
        public function main()
        {
            for(var i:uint = 0; i < 200; i++)
            {
                obj[i] = new ball();
                stage.addChild(obj[i]);
            }
            
            stage.addEventListener(Event.ENTER_FRAME, frame);
        }
        
        private function frame(e:Event):void
        {
            for(var i:String in obj)
            {
                obj[i].run();
            }
        }
    }
}

import flash.display.*;
import flash.filters.*;

class ball extends Shape
{
    private var r:uint = 15;
    private var s:uint = Math.round(Math.random() * 5) + 5;
    
    function ball()
    {
        x = Math.round(Math.random() * 450);
        y = Math.round(Math.random() * 450);

        graphics.beginFill(Math.round(Math.random() * 255 * 255 * 255), 1);
        graphics.drawCircle(0, 0, r);
        graphics.endFill();
        
        this.filters = [new DropShadowFilter(4, 45, 0, 0.5)];
    }
    
    public function run():void
    {
        if(y - r > stage.stageHeight)
        {
            x = Math.round(Math.random() * 450);
            y = -r;
            s = Math.round(Math.random() * 5) + 5;
        }
        
        y += s;
    }
}