hej, håller på med en massa flygplan + skott
[B]skapa skott[/B]
n=0;
this.createEmptyMovieClip("a", this.getNextHighestDepth());
function shot(){
a=this.attachMovie("shot","shot"+n,this.getNextHighestDepth());
}
[B]skapa plan;[/B]
planeNum=0;
this.createEmptyMovieClip("a", this.getNextHighestDepth());
function getPlane(){
planeNum++;
plane=this.attachMovie("plane","plane"+planeNum,
this.getNextHighestDepth());
}
[B]kod i skottet;[/B]
this.onEnterFrame=function(){
for(i=0; i<planeNum; i++){
if(this.hitTest(_root.["plane"+i]) == true){
_root["plane"+i].swapDepths(_root["plane"+i].getNextHighestDepth());
_root["plane"+i].removeMovieClip();
}
}
}
efter ett tag kommer man lätt upp i 256 mc's (plan+skott) vilket ej är tillåtet,
hur löser man detta, jag använder removeMovieClip men de verkar stanna kvar ändå på något sätt, inte visuellt men kanske i ramet ?
då tänkte jag att det kanske funkar om jag nollställer min counters (planeNum), men då "träffar" inte skotten av någon anleding, bara lite pill med depth antar jag men skulle detta kunna vara en lösning???
vad händer när man skapar ett movieClip, this.createEmpty... + this.removeMovieClip() ???
[B]ERRROR:[/B]
"256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie."
mvh
xhlin