/**
* @author:Gaara
* 2012-3-5
*
**/
public class Ball extends Sprite
{
public function Ball(x:Number,y:Number,z:Number,color:int=0x00FF00,radius:Number=5)
{
super();
var ball0:Ball = new Ball(100,100,0);
var ball1:Ball = new Ball(0,100,0);
var ball2:Ball = new Ball(0,0,0);
var ball3:Ball = new Ball(100,0,0);
var ball4:Ball = new Ball(100,100,100,0xFF0000);
var ball5:Ball = new Ball(0,100,100,0xFF0000);
var ball6:Ball = new Ball(0,0,100,0xFF0000);
var ball7:Ball = new Ball(100,0,100,0xFF0000);
for each (var ball:Ball in ballVec)
{
addChild(ball);
}
this.addEventListener(Event.ENTER_FRAME,onAdd);
}
protected function onAdd(event:Event):void
{
for each (var ball:Ball in ballVec)
{
var _x:Number = ball._x*Math.cos(radian) - ball._y*Math.sin(radian);
var _y:Number = ball._y*Math.cos(radian) + ball._x*Math.sin(radian);