forked from: flash on 2010-2-4

by 084 forked from flash on 2010-2-4 (diff: 6)
♥0 | Line 32 | Modified 2010-02-04 23:26:39 | MIT License
play

ActionScript3 source code

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

// forked from 084's flash on 2010-2-4
package {
    import flash.display.Sprite;
     import flash.events.Event;
     public class Main extends Sprite {
         private var square:Sprite;
		 private var angle:Number = 0;
                 private var radius:Number = 50;
         public function Main():void {
             square= new Sprite();
             with (square.graphics) { 
                 lineStyle(1, 0, 1); 
                 beginFill(0xdcdcdc);
        
                 moveTo(0,-5); 
                 lineTo(0,5); 
                 moveTo(-5,0); 
                 lineTo(5,0); 

                 moveTo(0-50, 0-50); 
                 lineTo(100-50, 0-50); 
                 lineTo(100-50, 100-50); 
                 lineTo(0-50, 100-50);         
                 endFill();
             }
            //square.x = stage.stageWidth/2
            //square.y = stage.stageHeight/2 
		 this.addChild(square); 
		 square.addEventListener(Event.ENTER_FRAME, onEnterFrame);
		 }
		 public function onEnterFrame(event:Event):void {
			square.y = stage.stageHeight / 2 + Math.sin(angle) * radius;
			square.x = stage.stageHeight / 2 + Math.cos(angle) * radius;
			angle += .1;
		 }
	 }
}