flash on 2010-4-14
/**
* Copyright kihon ( http://wonderfl.net/user/kihon )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/c8Ft
*/
package
{
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
private var data:Array = new Array();
public function Main()
{
for (var degree:int = 0; degree < 360; degree += 360 / 20)
{
var circle:Circle = new Circle();
circle.degree = degree;
circle.move();
addChild(circle);
data.push(circle);
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void
{
for (var i:int = 0; i < data.length; i++) data[i].move();
}
}
}
import flash.display.Sprite;
class Circle extends Sprite
{
public var degree:Number;
public function Circle()
{
graphics.beginFill(int.MAX_VALUE * Math.random());
graphics.drawCircle(0, 0, 10);
graphics.endFill();
this.y = 232;
}
public function move():void
{
this.x = 232 + Math.cos(degree * Math.PI / 180) * 200;
this.z = 232 + Math.sin(degree * Math.PI / 180) * 200;
degree++;
}
}