6 Replies Latest reply on May 30, 2011 2:04 AM by Pandelis1234

    Make a "Previous page" button.

    Pandelis1234

      Hello, I'm new to Flash and a few days now I'm trying to make an AIR application to share with my co-students.

       

      Since AIR apps are on their own window -not in browser- they have not navigation buttons. I know I can link a button to take me back to a page... but... there's a page (A) that can be accessed through many pages(1,2,3).

      Is there a way that a single button would take me to the last visited page? I think I that has to do with variables but in Catalyst...?

       

      One solution is to make 3 buttons in pageA leading to page1, page2 and page3... HORRIBLE!

      I would appreciate any ideas. -and hurry, i'm already halfway the trial !

       

      Pandelis.

        • 1. Re: Make a "Previous page" button.
          ChanceDogUSA

          Lets say for the sake of argument you have 5 pages. Add a button to all 5 pages. With the button selected on any page, go to the buttons interactions panel on the right hand side. At the top click add interaction. Choose when in state 5, go to state 4. click ok. click the add interaction button again. Then tell it to go to state 3 when in state 4…repeat until complete. A forward button can also be created by this method.

           

          Have fun with it.

           

          ChanceDogUsa

          • 2. Re: Make a "Previous page" button.
            Pandelis1234 Level 1

            Thank you ChanceDogUSA for your answer but that's not my problem. I know how to link pages folowng each other.


            Imagine that all four pages leads to a fifth one. Then what interaction should I assign to the button to take me to the page I was before (not necessarily page4, maybe 3)?

            Does flash hold memory of the page/stage I was before?

            • 3. Re: Make a "Previous page" button.
              ChanceDogUSA Level 1

              you mean a back button that works like the back button on an explorer bar in the web browser?

              • 4. Re: Make a "Previous page" button.
                Pandelis1234 Level 1

                Yes, it could be that.

                • 5. Re: Make a "Previous page" button.
                  Chris W. Griffith Adobe Community Professional

                  I can think of two solutions:

                   

                  If you have enough available states left in your project (Flash Catalyst only supports 20 top level states), you could duplicate the page that each of the four states points to, so that each of the four entry pages points to a 'custom' version where the back button is hard wired to return to the proper state. This ranks high on the hackish scale, but will get the job done.

                   

                  The other is to add some ActionScript to your project using Flash Builder. You need to have a global variable to stores the returnState. This variable is updated as you leave one state to another. The return button then uses that variable to reset the state of the application. I can build a demo of this if you need one.

                   

                  Hope this helps,

                   

                  Chris

                  1 person found this helpful
                  • 6. Re: Make a "Previous page" button.
                    Pandelis1234 Level 1

                    Thank you Chris that's exactly what I wanted!

                    Could you please provide the code for this or post a link relevant with variables in Builder? With no other experience in builder I would impair my project.

                     

                    Thank you again for your time.

                    Pandelis