2 Replies Latest reply on Oct 9, 2007 12:31 PM by 3-Putt

    removeMovieClip problem

    3-Putt
      I have a button to attach a movie called "ColorChipPopUp".

      attachMovie_btn3.onRelease = function(){
      this._root.attachMovie("ColorChipPopUp", "chip", 3);
      _parent.chip._x = 340;
      _parent.chip._y = 200;
      };

      The button (instance name "attachMovie_btn3") is in a movie called "corkboard" on scene 1. In the movie, "ColorChipPopUp" I have a close button that removes the movie clip from the parent movie "corkboard".

      on (release) {
      _root.chip.removeMovieClip();
      }

      Everything works fine until...I want to do when I remove the "ColorChipPopUp" movie and go to different frame in the "corkboard" movie (instance name is corkboard).

      on (release) {
      _root.chip.removeMovieClip();
      _root.corkboard.gotoAndPlay(146)
      }

      What am i missing in this script "_root.corkboard.gotoAndPlay(146)"?

      Thanks Brian
        • 1. Re: removeMovieClip problem
          clbeech Level 3
          OK, first thing, ace the 'this._root' from the attachMovie call, and use '_parent', you can also pass the x,y parameters within a Init Object in the method, as in:

          _parent.attachMovie('ColorChipPopUp', 'chip', 3, {_x:340, _y:200});

          ... now a few things I'm not following, I assume that this attaches the 'chip' to the main timeline at level 3, but you go on to say that your removing the 'chip' from the MC 'corkboard' is 'corkboard' the name of your swf? because other wise the call '_root.chip.removeMovieClip();' is not removing the 'chip' MC from the MC 'corkboard' so this is very confusing. Further you go on to say that you want to call to 'corkboard' to advance it's timeline to 146, well is there a MC named 'corkboard' or did you maybe give Scene 1 that name or something, because if the call '_root.chip.removeMovieClip();' does what it is suppose to like you say is working, there is no 'corkboard' MC, and the call should be:

          _root.gotoAndPlay(146);

          Sorry, just confused ;)
          • 2. Re: removeMovieClip problem
            3-Putt Level 1
            The corkboard is a movieclip on the root and the ColorChipPopUp movieclip is attached over the corkboard movieclip. Hope your not too confused because I am.

            This _parent.attachMovie('ColorChipPopUp', 'chip', 3, {_x:340, _y:200}); worked great, but
            _root.gotoAndPlay(146); brings me to scene 1 frame 1 and I want to get to frame 146 in the corkboard movie clip which is in in frame 3 on scene 1 with a stop command.

            I hope that is easier to understand.
            thx