Reputation: 351
I have a warning about this:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() I don't what is wrong with the code.
public function Laser() {
}
Upvotes: 1
Views: 120
Reputation: 2885
You add laser to the stage, so remove it also from the stage.
if(lasers[l].y < 0)
{
stage.removeChild(lasers[l]); // <- Here
lasers[l] = null;
lasers.splice(l, 1);
trace("Remove laser from screen");
}
Upvotes: 1