2012年11月5日 星期一

2012.11.5-actionscript-array movieclip click tagget




for(var i:int = 0; i{

var ballArr:Array = [];
var tempBall:ball;


 tempBall = new ball();
 ballArr[i] = tempBall;

 tempBall.addEventListener(MouseEvent.CLICK, click_handler);


   addChild(ballArr[i]);
}




function click_handler(e:MouseEvent) {

 if(!(e.target).isDead()){
    dosomething();
 }


}

沒有留言:

張貼留言