I had a button, with that button a movieclip is called on the stage and it is working fine with the below script
var mc:mc_lemon
var btn: btn_Lemon
mc=new mc_lemon();
btn = new btn_Lemon();
addChild(btn);
btn.x = 304.45;
btn.y = 209.8;
mc.x=304.45;
mc.y=209.8;
btn.addEventListener(MouseEvent.CLICK, addF);
function addF(e:MouseEvent):void{
addChild(mc);
}
Now I am trying to remove the movieclip itself from the stage after reaching its last frame, but failed.
I was trying to remove it by placing this script at its last frame this.parent.removeChild(this);
but failed