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-6-18

Get Adobe Flash player
by takawo 17 Jun 2009
    Embed
/**
 * Copyright takawo ( http://wonderfl.net/user/takawo )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/8iK9
 */

package {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.events.Event;
    import flash.events.MouseEvent;
    
    public class FlashTest extends Sprite {
        private var tf:TextField;
        private var sp:Sprite;
        private var spBase:Sprite
        [SWF(backgroundColor="#333333", frameRate=10)]
        public function FlashTest()
        {
            spBase = new Sprite();
            addChild(spBase);
            for(var i:uint = 0; i < 1000; i++)
            {
                sp = new Sprite();
                sp.graphics.beginFill(Math.random()*0xFFCCFF);
                sp.graphics.drawCircle(Math.random()*450,
                            Math.random()*450,10);
                addChild(sp);
                sp.name = "circle" + i;
                sp.alpha = 0.2;
                sp.addEventListener(MouseEvent.CLICK,onClick);
                sp.buttonMode = true;
                sp.useHandCursor = true;
            }
            
            tf = new TextField();
            addChild(tf);
            tf.text ="hello world!";
            
        }
        private function onClick(event:MouseEvent):void
        {
            tf.text = event.target.name
        }
    }
}