2012年11月5日 星期一

2012.11.5-actionscript-array movieclip add child


var ballArr:Array = [];
var tempBall:ball;
var numOfBall:Number=10;


for(var i:int = 0; i{

 tempBall = new ball();

 ballArr[i] = tempBall;

 tempBall.x = 0;
 tempBall.y = 0;

 tempBall.rotation=30;

 tempBall.addEventListener(MouseEvent.CLICK, click_handler);

   addChild(ballArr[i]);
}

沒有留言:

張貼留言