I store all Actors in an array called allActors. For example:
Now when I nuke the Actor, Body and graphic I also want to clear the item from the array. My logic says:
But this doesn't work and gives the error:
1120: Access of undefined property reqjecActor.
What am I doing wrong and how can I fix this?
Code:
allActors.push(reqjecActor);
Now when I nuke the Actor, Body and graphic I also want to clear the item from the array. My logic says:
Code:
var index:Number = allActors.indexOf(reqjecActor);
allActors.splice(index, 1);
allActors.splice(index, 1);
But this doesn't work and gives the error:
1120: Access of undefined property reqjecActor.
What am I doing wrong and how can I fix this?