flash on 2011-1-14

by elbib
♥0 | Line 21 | Modified 2011-01-14 15:33:07 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.events.*;
    
    public class FlashTest extends Sprite {
        
        private var arrow:Sprite;
        private var vr:Number = 5;
        
        public function FlashTest() {
            // write as3 code here..
            arrow = new Sprite();
            arrow.graphics.beginFill(0xff0000, 1);
            arrow.graphics.drawRect(-20,-20,40,40);
            addChild(arrow);
            arrow.x = stage.stageWidth / 2;
            arrow.y = stage.stageHeight / 2;
            this.addEventListener(Event.ENTER_FRAME, onEnter);
        }
        private function onEnter(e:Event):void
        {
            arrow.rotation += vr;
        }

    }
}