New to flash as3 need some help, cant seem to get past a 2025 error when remove child is used.
My player hits of an object called present_mc2 and is removed but an error comes up on stage.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at VinnieBaggeB00033245_fla::MainTimeline/detecthit()
heres my code
var present2_mc:MCpresent = new MCpresent();
stage.addChild(present2_mc);
present2_mc.x=87;
present2_mc.y=305;
stage.addEventListener(Event.ENTER_FRAME, detecthit);
function detecthit(event:Event):void
{
{
removeChild(present_mc);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, detecthit);
}
}