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 2012-4-27

Get Adobe Flash player
by tnRaro 27 Apr 2012
    Embed
package {
    import flash.display.Sprite;
    import flash.display.Graphics;
    
    import flash.events.MouseEvent;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            var a:Array = [];
            
            var i:int = 0;
            
            var button:Sprite = new Sprite();
            button.graphics.beginFill(0);
            button.graphics.drawRect(0,0,100,50);
            button.graphics.endFill();
            addChild(button);
            
            for(i = 0; i < 100; i++)
            {
                a[i] = new Sprite();
                a[i].graphics.beginFill(i*i*i*i);
                a[i].graphics.drawCircle(0,0,i / 10);
                a[i].graphics.endFill();
                a[i].x = Math.random() * stage.stageWidth;
                a[i].y = Math.random() * stage.stageHeight;
                addChild(a[i]);
            }
            i = 100;
            
            
            function asdf(e:MouseEvent):void
            {
                removeChild(a[i]);
                i--;
            } button.addEventListener(MouseEvent.CLICK, asdf);

        }
    }
}