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

RotationalVelocity

Get Adobe Flash player
by crossisland 07 Nov 2011
    Embed
/**
 * Copyright crossisland ( http://wonderfl.net/user/crossisland )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/bH4E
 */

package {
    import flash.display.Sprite;
    import flash.events.Event;
    
    public class RotationalVelocity extends Sprite {
        private var arrow:Arrow;
        private var vr:Number = 5;
        
        public function RotationalVelocity() {
            init();
        }
        
        private function init():void {
            arrow = new Arrow();
            addChild(arrow);
            arrow.x = stage.stageWidth / 2;
            arrow.y = stage.stageHeight / 2;
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }

        public function onEnterFrame(event:Event):void {
            arrow.rotation += vr;
        }
    }
}

import flash.display.Sprite;

class Arrow extends Sprite {
    public function Arrow() {
        graphics.beginFill(0x000000);
        graphics.moveTo(-40, -20);
        graphics.lineTo(0, -20);
        graphics.lineTo(0, -40);
        graphics.lineTo(40, 0);
        graphics.lineTo(0, 40);
        graphics.lineTo(0, 20);
        graphics.lineTo(-40, 20);
        graphics.lineTo(-40, -20);
        graphics.endFill();
    }
}