6 Replies Latest reply on Mar 26, 2007 1:07 PM by kglad

    Back Button Script

    SM6601 Level 1
      I tried the below solution and it doesn't work entirely. It works when I navigate away from the main menu which is the first time the back button appears in the timeline. Elsewhere in the project, the back button doesn't function properly. Any more solutions? I'm still looking for a proven solution that will work with many buttons and possible navigation routes throughout my movie.




      previousFrame=_root._currentframe;

      // and attached to your back button use:

      backBtn.onPress=function(){
      _root.gotoAndStop(previousFrame);
      }
        • 1. Re: Back Button Script- KGLAD
          kglad Adobe Community Professional & MVP
          what do you mean by "...when i navigate away from the main menu"? are you trying to play frames that are NOT on the main timeline?
          • 2. Re: Back Button Script- KGLAD
            SM6601 Level 1
            I only have one flash movie w/ one main timeline. The first instance of the back button is on frame 413, the main menu after the intro animation. Back button works from the main menu to the first frame away from the main menu. But deeper into the project where the main menu isn't the frame where the movie is supposed to go back to, the back button doesn't work.
            • 3. Re: Back Button Script
              kglad Adobe Community Professional & MVP
              your back button needs to exist after you code its mouse handler.

              if you execute the handler for your back button and then remove the back button, your code is gone too. if you then (re)create your back button, you'll need to (re)execute the code for your back button.
              • 4. Re: Back Button Script
                kglad Adobe Community Professional & MVP
                your back button needs to exist after you code its mouse handler.

                if you execute the handler for your back button and then remove the back button, your code is gone too. if you then (re)create your back button, you'll need to (re)execute the code for your back button.
                • 5. Re: Back Button Script
                  SM6601 Level 1
                  I think what your saying is that I need to insert the code for the back button as well as all other buttons on every frame where the movie stops. I have several 30 frame transitions after most of my frame labels. This seemed to be causing a problem w/ back button navigation. I will work w/ this some more, because if this is a workable solution it is worth the effort. Thanks, SM
                  • 6. Re: Back Button Script
                    kglad Adobe Community Professional & MVP
                    the easiest solution for a button that doesn't always need to be on-stage may be to use the buttons _visible property.