Search code examples
actionscript-3flashframemovieclipaddchild

Is it possible to add a Movieclip in a specific frame?


I add a menu button in the first frame (from an external class). When i click it, it goes to the second frame, and it's still there.

Is it possible to add a mc in a specific frame? I try to remove it while clicking on it but it gives me error...

Thanks!


Solution

  • You can remove your button by clicking like that :

    function clicBouton(e:MouseEvent):void
    {
        gotoAndStop(2);
        e.target.parent.removeChild(e.target);
    }