FYI, I think you have a little mistake.
below code same error.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
It's your case?
var mc:MovieClip = new MovieClip();
addChild(mc);
var childMc:MovieClip = new MovieClip();
mc.addChild(childMc);
//this line wrong.
stage.removeChild(childMc);
If you case, stage.removeChild(childMc); change to mc.removeChild(childMc);
removeChild() means Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. as parent.removeChild(child);
stage is childMc parent of parent.
mc is childMc parent.
or this case?
var mc:MovieClip = new MovieClip();
addChild(mc);
var childMc:MovieClip = new MovieClip();
mc.addChild(childMc);
stage.removeChild(mc);
while(mc.numChildren)
{
mc.removeChildAt(0);
}
If you this case, mc is removed by this line stage.removeChild(mc);
trying to mc child removeChild. already mc removed, so occur error. child must be removed from most below.
change to
while(mc.numChildren)
{
mc.removeChildAt(0);
}
stage.removeChild(mc);
If you want clearly answer. must attach a code.