/**
* Copyright Tamanegi_kenshi ( http://wonderfl.net/user/Tamanegi_kenshi )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/z4Iw
*/
package{
import flash.display.Sprite;
import flash.events.Event;
[SWF(width=465,height=465,backgroundColor=0)]
public class test extends Sprite{
private var ball:BALL;
private var Balls:Array;
private var ballsNum:int =6;
private var spring:Number =0.1;
private var gravity:int =0;
private var friction:Number =0.5;
private var angle:Number=0;
private var radius:int=200;
public function test(){
init();
}
private function init():void{
Balls =new Array();
for(var i:int=0;i<ballsNum;i++){
ball =new BALL(10,Math.random()*0xffffff);
addChild(ball);
Balls.push(ball);
}
addEventListener(Event.ENTER_FRAME,on);
}
private function on(event:Event):void{
for(var i:int=1;i<ballsNum+1;i++){
angle +=0.5;
var radias:Number=angle*Math.PI/180;
Balls[i-1].x=465/2+Math.cos(radias+i)*radius;
Balls[i-1].y=465/2+Math.sin(radias+i)*radius/5;
}
}
}
}
import flash.display.Sprite;
class BALL extends Sprite{
public var radius:int;
public var color:uint;
public var vx:Number =0;
public var vy:Number =0;
public function BALL(radius:int=10,color:uint=0x000000){
this.radius =radius;
this.color =color
graphics.beginFill(color);
graphics.drawCircle(0,0,radius);
graphics.endFill();
}
}