Applying Animation Techniques to Other Properties : Rotation « Animation « Flash / Flex / ActionScript






Applying Animation Techniques to Other Properties

 
package {
    import flash.display.Sprite;
    import flash.events.Event;
    
    public class Main extends Sprite {
        private var _sprite:Sprite = new Sprite(  );
        private var _vr:Number = 4;
        
        public function Main(  ) {
            _sprite.graphics.beginFill(0xffffff, 100);
            _sprite.graphics.drawEllipse(-50, -20, 100, 40);
            _sprite.x = 10;
            _sprite.y = 10;
            addChild(_sprite);
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }
        
        public function onEnterFrame(event:Event):void {
             _sprite.rotation += _vr;
        }
    }    
}

        








Related examples in the same category