If i have enemy array in main timeline, how would you splice 1 object from this array using function that is inside enemy.as file?
i tried using this:
private function removeSelf():void
{
MovieClip(root).enemyList.splice(this);
MovieClip(root).back.collision.removeChild(this);
}
But it splices entire array. i also tried this:
private function removeSelf():void
{
MovieClip(root).enemyList.splice(0, 1);
MovieClip(root).back.collision.removeChild(this);
}
But this way it doesn’t remove a last enemy alive – 1 enemy remains on the stage and it’s impossible to remove him from array.