I added a function in the EnemyShip class, which removes the EnemyShip from the enemies array in the Ship class, when it is destroyed or moves out of scope. This can make a difference in performance if you use big arrays.
Here' the function:
function removeFromArray()
{
for(var i in _root.ship.enemies)
{
if(this == _root.ship.enemies[i])
{
_root.ship.enemies.splice(i,1);
}
}
}
Add it somewhere in the EnemyShip class and execute it when the ship is destroyed or moves left out of the stage.The splice(a,1) function removes 1 object on the a-th position from an array.
Since I'm new to Flash a pro should take a lot at this and correct me if I'm wrong.