as3 砖块程序

我复制了18x6个对象

init();

var brick:MovieClip;

 function init():void {

   for (var i=0; i<18; i++) {

    for (var j=0; j<6; j++) {

     brick=new MovieClip();

     addChild(brick);

     brick.x=i*30;

     brick.y=j*10;

     brick.name="brick"+i+j;

     trace(brick.name);

    // brick.addEventListener(Event.ENTER_FRAME,hitonEnterFrame);

    }

   }
 }

你可能感兴趣的:(J#)