i am trying to add a movieClip from the Library at run time.i created a clip named ‘smoke’ i linked it . its class name is ‘Smoke’. i want to add it to a clip named ‘monster’ when i click on the ‘monster’ clip. so inside the ‘monster’ clip i have the next code:
function killMonster(event:MouseEvent):void
{
smoke=new Smoke();
this.parent.addChild(smoke);
smoke.x = this.x;
smoke.y = this.y;
this.parent.removeChild(this);
}
but i keep getting this:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Smoke/frame11()
i am not sure who the caller is and how to reach it?