正确读取了多数组,但读出了他搞砸的数组。假设对数组中数组的每个元素执行的操作,当在 2 个数组中创建更多索引时,他不再执行此操作。
当我在 2 数组中创建第二个索引时,他不再对前一个索引执行此操作,只有最后一个索引。
谢谢
private var Enemy:Array = new Array();//1st array
private var EnemyHull:Array = new Array();
private var waves:Array = new Array();//2 array ==> array 1 get in this
private function enterFrame(e:Event):void
{
//Enemy Ai
for(var i2:uint; i2 < waves.length; i2++){
for(var i:uint; i < Enemy.length; i++){
waves[i2][i].x -= 1;//when a second index in 2 array i made he doesn't do this action anymore on previous index, only the last made index.
}
}
}
private function enemySpawnen(event:TimerEvent):void
{
for(var i:uint = 0; i < hoeveelheidEnemy;i++){
//
}
if(Enemy[i] != null){;
viewContainer.addChild(Enemy[i]);
//
}
}
waves[iwaves] = Enemy;
iwaves++;
}
function shoot(e:Event):void
{
//
try{
for(var i2:uint; i2 < waves.length; i2++){
for(var i:uint = Enemy.length-1; i >= 0;i--){
if(kogel.hitTestObject(waves[i2][i])){
//
}
}
}
}
}
catch(e:Error){
}
}
}