3 Replies Latest reply on Apr 7, 2011 7:24 PM by Ned Murphy

    gotoAndStop(); randomly moves to frames

    Aaron-009

      Hi,

       

      I'm using gotoAndStop(); for my buttons within flash using the following method:

       

      myButtonInstance.onRelease = function() {

           gotoAndStop("frame5");

      }

       

      however, I've come accross a problem where in for some reason the application will sometimes move frames when I don't want it to. For example, given the code above it would sometimes go to frame 5, but then instantly move somewhere else from there despite the code saying only to do so when a button is pressed.

       

      If anyone has any idea at all as to why this may be happening I would very much appreciate it.

        • 1. Re: gotoAndStop(); randomly moves to frames
          Ned Murphy Adobe Community Professional & MVP

          Is that the only code in your file?  Is that the only code you have assigned to that object?  Do you have any form of enterFrame code working?

          • 2. Re: gotoAndStop(); randomly moves to frames
            Aaron-009 Level 1

            This isn't the only code, however I couldn't really post more as I have a lot of it, sorry about the lack of specifics. That is the only code assigned to the button yes. And there are no EnterFrame functions working on this frame. Out of interest, is there a difference between goToAndStop() and gotoAndStop()?

            • 3. Re: gotoAndStop(); randomly moves to frames
              Ned Murphy Adobe Community Professional & MVP

              I'd say yes on two fronts... 1) the obvious use of an uppercase T in one and 2) using the lower case t is the correct way to code it.  But someone once made aware that AS2 is sometimes not picky about proper casing... I just don't know if gotoAndStop() is one of the sometimes.

               

              In any case, the only code you showed would not cause something to move to more than one place in the timeline.  If you were to have used gotoAndPlay() telling an object to go where it already is, it will move ahead instead.

              1 person found this helpful