1 Reply Latest reply on Oct 6, 2011 2:45 PM by kglad

    button that replaces a movieclip

    147539

      so,im trying to make a button that replaces a movie clip.Basicly when you press on a button it replaces a movie clip that lets say i called ˝movie_1˝ that is already on the stage with a movie clip in the library i called ˝movie_2˝.

      Both movie clip have this already as an action onClipEvent(enterFrame){ mouse.hide(); this._x=_root._xmouse; this._y=_root._ymouse; }

        • 1. Re: button that replaces a movieclip
          kglad Adobe Community Professional & MVP

          // assign your library movieclip a linkage id. eg, mcID

           

           

          yourbutton.onRelease=function(){

          var p:Movieclip=movie_1._parent;

          p.attachMovie("mcID","new_mc",p.getNextHighestDepth(),{_x:movie_1._x,_y:movie_1._y});

          movie_1.swapDepths(p.getNextHighestDepth());

          movie_1.removeMovieClip();

          }

          1 person found this helpful