12 Replies Latest reply on Jun 9, 2007 8:34 AM by Proddy2k

    History Buttons

    Proddy2k
      I have a button which I want to go back to the previous page that the user was on. Normally it would be back to the previous marker but I want it to be so that they go back to the page they were on. Any ideas how I can code this?

      Thanks in advance

      Proddy
        • 1. Re: History Buttons
          Level 7
          You can use a global variable to store the marker you want to jump back to.

          In the frame script put something like:

          global gBackMarker
          on ExitFrame me
          gBackMarker = the frameLabel
          end

          Then in another behavior on your button:

          global gBackMarker
          on mouseup me
          go to gBackMarker
          end

          Note: typed in quickly and not tested.
          //Slashy: Only work for one level of going back.

          Timm



          "Proddy2k" <webforumsuser@macromedia.com> wrote in message
          news:f46ieo$78g$1@forums.macromedia.com...
          >I have a button which I want to go back to the previous page that the user
          >was
          > on. Normally it would be back to the previous marker but I want it to be
          > so
          > that they go back to the page they were on. Any ideas how I can code this?
          >
          > Thanks in advance
          >
          > Proddy
          >


          • 2. Re: History Buttons
            Proddy2k Level 1
            quote:

            Originally posted by: Newsgroup User
            You can use a global variable to store the marker you want to jump back to.

            In the frame script put something like:

            global gBackMarker
            on ExitFrame me
            gBackMarker = the frameLabel
            end

            Then in another behavior on your button:

            global gBackMarker
            on mouseup me
            go to gBackMarker
            end

            Note: typed in quickly and not tested.
            //Slashy: Only work for one level of going back.

            Timm



            "Proddy2k" <webforumsuser@macromedia.com> wrote in message
            news:f46ieo$78g$1@forums.macromedia.com...
            >I have a button which I want to go back to the previous page that the user
            >was
            > on. Normally it would be back to the previous marker but I want it to be
            > so
            > that they go back to the page they were on. Any ideas how I can code this?
            >
            > Thanks in advance
            >
            > Proddy
            >





            Thanks for the prompt reply. I added a behavior to the frame and to the button but now when I click on the button it takes me back to the beginning frame but I want it to go to the last frame I was on?
            • 3. Re: History Buttons
              Level 7
              What do you mean by page, and how do you go from page to page, and how do
              you hold the score on a page?

              I think you might be able to change where it says Marker in my script to
              Frame and instead of storing the framelabel set gBackFrame = the frame and
              it should store the number of the frame in the score. However if you jump to
              another frame with the same script it will update to the current one. So
              that's why I'm curious how you go to each page and stay there.

              >
              > Thanks for the prompt reply. I added a behavior to the frame and to the
              > button
              > but now when I click on the button it takes me back to the beginning frame
              > but
              > I want it to go to the last frame I was on?
              >


              • 4. Re: History Buttons
                Level 7
                Also, go to www.mediamacros.com, then click the Behavior link. Then search
                for "back". There are some "back" behaviors that might work for you.

                Cheers,
                Timm


                • 5. Re: History Buttons
                  James Newton, ACP Level 3
                  You can find a demo with source code at http://nonlinear.openspark.com/tips/navigation/history/.
                  • 6. Re: History Buttons
                    Proddy2k Level 1
                    quote:

                    Originally posted by: openspark
                    You can find a demo with source code at http://nonlinear.openspark.com/tips/navigation/history/.


                    Thanks for that, I have tried to understand it but find it difficult. Basically I have a screen which says Quit confirmation and two buttons yes or no. Yes quits the application but No should take the user back to their previous page they were on. Any ideas how to implement this as I have tried but no luck yet!
                    • 7. Re: History Buttons
                      Level 7
                      Can't you do it with the behaviors from the library?

                      Use the "go marker" behavior to move the playbackhead to the
                      confirmation screen and it's companion on the "no" button to move back
                      in the history.

                      I'm not behind Director now, so behaviornames may be off, but a good
                      look through the behavior library should get you what you need.

                      HTH,
                      Manno


                      Proddy2k wrote:
                      >
                      quote:

                      Originally posted by: openspark
                      > You can find a demo with source code at
                      > http://nonlinear.openspark.com/tips/navigation/history/.[/q
                      >
                      > Thanks for that, I have tried to understand it but find it difficult.
                      > Basically I have a screen which says Quit confirmation and two buttons yes or
                      > no. Yes quits the application but No should take the user back to their
                      > previous page they were on. Any ideas how to implement this as I have tried but
                      > no luck yet!
                      >


                      --
                      ----------
                      Manno Bult
                      http://www.aloft.nl
                      • 8. Re: History Buttons
                        Proddy2k Level 1
                        Thanks I looked into it but when I click on the No button nothing happens. I looked at the library and I found Jump Back Button, Jump Forward Button, Jump To Marker Button and Jump To Movie Button behaviors. I applied the Jump Back Button to the No button but nothing still happens. Any ideas?
                        • 9. Re: History Buttons
                          James Newton, ACP Level 3
                          In the situation you describe, you could use the "play" command instead of the "go" command when you jump to the marker that shows the Quit confirmation. If the user presses "Yes", the application simply quits. If the user presses "No", you issue the command "play done", and the playback head will return to exactly the point that the "play" command was issued from.

                          In other situations, play .... play done may not be a wise choice.

                          Here's an extract from http://nonlinear.openspark.com/tips/other/playDone/

                          'Play ...' and 'play done' should be used with caution. Unbalanced use can lead to memory becoming locked. In certain situations, calling 'play done' can crash the Director player. In other situations 'play...' may be treated as a plain 'go...' command, and in yet others, 'play done' is silently ignored.
                          • 10. Re: History Buttons
                            Proddy2k Level 1
                            Now you have really confused me, can you please explain a bit more simply please as I am a newbie?
                            • 11. Re: History Buttons
                              Proddy2k Level 1
                              quote:

                              Originally posted by: openspark
                              In the situation you describe, you could use the "play" command instead of the "go" command when you jump to the marker that shows the Quit confirmation. If the user presses "Yes", the application simply quits. If the user presses "No", you issue the command "play done", and the playback head will return to exactly the point that the "play" command was issued from.

                              In other situations, play .... play done may not be a wise choice.

                              Here's an extract from http://nonlinear.openspark.com/tips/other/playDone/

                              'Play ...' and 'play done' should be used with caution. Unbalanced use can lead to memory becoming locked. In certain situations, calling 'play done' can crash the Director player. In other situations 'play...' may be treated as a plain 'go...' command, and in yet others, 'play done' is silently ignored.


                              Currently my exit button has the following code:

                              on mouseUp
                              go to frame "End Screen"
                              end

                              So you say I should change it to a play, how would I do this as I have never heard of it?

                              Thanks in advance!
                              • 12. History Buttons
                                Proddy2k Level 1
                                I changed it to

                                on mouseUp
                                play frame "End Screen"
                                end

                                and for the No button I added this code:

                                on mouseUp
                                play done
                                end

                                and it works a treat. Thanks for this mate but you said there may be problems. Can you clarify them?