2 Replies Latest reply on Apr 6, 2007 12:28 PM by TroyK

    Movie clip button trouble

    badhams Level 1
      I have a Movie clip on the main stage called CV_mc. In the CV_mc movie clip I have a movie clip button called next_mc.

      When I click the next_mc button I want to go to a frame labelled _pageTwo in the CV_mc timeline.

      I have added this AS code to a layer in the CV_mc timeline at the same time as when the buttons appear.

      next_mc.onRelease = function()
      {
      this.gotoAndStop("_pageTwo");
      }

      This wont work yet this will

      next_mc.onRelease = function()
      {
      _root.CV_mc.gotoAndStop("_pageTwo");
      }

      Thanks in advance
        • 1. Re: Movie clip button trouble
          Glenn Gervais
          When you say 'this' in the first function you're referring to next_mc. The problem is that your frame is in CV_mc, which is why the second function works. If you change the first function to this._parent.gotoAndStop("_pageTwo"); it will work.
          • 2. Re: Movie clip button trouble
            TroyK Level 1
            next_mc.onRelease = function(){
            trace(this);
            }

            next_mc.onRelease = function(){
            trace(_root.CV_mc)
            }

            if you run this you will see they are two different objects. That is why the first one doesn't work.

            What this really does:
            this.gotoAndStop("_pageTwo");
            is:
            _root.CV_mc.next_mc.gotoAndStop("_pageTwo");

            I hope this helps.

            tk