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.
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");
}
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more