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 2010-3-9

Get Adobe Flash player
by yaha 09 Mar 2010
    Embed
/**
 * Copyright yaha ( http://wonderfl.net/user/yaha )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/36RZ
 */

package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    
    public class MoveCircle extends Sprite {
        public function MoveCircle() {
            
            var CIRCLE:Sprite=new Sprite();
            
            CIRCLE.graphics.beginFill(Math.random()*0xffffff);
            CIRCLE.graphics.drawCircle(0,0,50);
            CIRCLE.graphics.endFill();
            
            addChild(CIRCLE);
            
            CIRCLE.x=232;
            CIRCLE.y=232;
            
            CIRCLE.buttonMode=true;
            
            CIRCLE.addEventListener(MouseEvent.MOUSE_DOWN,onMD);
            CIRCLE.addEventListener(MouseEvent.MOUSE_UP,onMU);
            
        }
        private function onMD(e:MouseEvent):void{
        	e.currentTarget.startDrag();
        }
        private function onMU(e:MouseEvent):void{
        	e.currentTarget.stopDrag();
        }
    }
}