I have seen many questions on removeChild.
I've got an invaders type game, where bricks are falling from top, and you have to destroy them with a ball that keeps bouncing around.
When I want to remove the brick (referencing it with an array in a for loop), I randomly get the exception error (like many others) that the object must be a child of the caller.
This was a solution:
if (this.parent != null)
{
this.parent.removeChild(this);
}
-- that is in my case, called from within the class of the target object (the brick).
BUT the thing is.. if this.parent really IS null the brick just stays there! (when it should have been removed)