flash on 2010-4-14

by kihon
♥0 | Line 26 | Modified 2010-04-14 00:32:46 | MIT License
play

ActionScript3 source code

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

package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class Main extends Sprite
	{
		private var circle:Sprite;
		private var degree:Number = 0;
		
		public function Main()
		{
			circle = new Sprite();
			circle.graphics.beginFill(0x0);
			circle.graphics.drawCircle(0, 0, 20);
			circle.graphics.endFill();
			circle.x = 232;
			addChild(circle);
			
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}
		
		private function onEnterFrame(event:Event):void
		{
			circle.x = stage.stageWidth / 2 + Math.cos(degree * Math.PI / 180) * 200;
			circle.z = stage.stageHeight / 2 + Math.sin(degree * Math.PI / 180) * 200;
			degree++;
		}
	}
}