flash on 2012-10-4

by baudon.thomas
♥0 | Line 24 | Modified 2012-10-04 22:19:22 | MIT License
play

ActionScript3 source code

/**
 * Copyright baudon.thomas ( http://wonderfl.net/user/baudon.thomas )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/2mbrg
 */

package {
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.display.ShaderParameter;
    import flash.display.Sprite;
    import flash.display.Shape;
    
    public class FlashTest extends Sprite {
        
        private var rond:Shape;        
        
        public function FlashTest() {
            // write as3 code here..
            rond = new Shape();
            
            rond.graphics.beginFill(0x000000);
            rond.graphics.drawCircle(0,0,20);
            
            this.addChild(rond);
            
            var timer:Timer = new Timer(30);
            timer.addEventListener(TimerEvent.TIMER, onTimer);
            timer.start();
        }
        
        private function onTimer(e:TimerEvent):void
        {
            this.rond.x -= (this.rond.x - mouseX) * 0.1;
            this.rond.y -= (this.rond.y - mouseY) * 0.1;
        }

    }
}