5 Replies Latest reply on Jan 12, 2011 4:29 AM by Max Borge

    Incorrect Navigation from homepage

    Max Borge

      I am using AS3.0

       

      I have created simple forward naviagtion from my homepage to my second screen using the code below and a simple button (click1)

       

      //handle events for buttons...

      click1.addEventListener(MouseEvent.CLICK, clickSection1);

      function clickSection1(evtObj:MouseEvent){

      //go to the section clicked on...

      gotoAndStop("screen3");

      }

       

       

      Slightly modified code is used on consequent pages to navigate forward through my site.

       

      I have also created a home button that navigates me back to my first screen (called screen2) using the following code...

       

      home_btn.addEventListener(MouseEvent.CLICK, clickhome1);

      function clickhome1(e:MouseEvent):void

      {gotoAndStop("screen2")

      }

       

      However, when I return to the homepage and click forward, instead of taking me to the next page and the next page, it jumps me forward directly to the 5th. screen.

       

      Any help is much appreciated.

       

      Thankyou

       

      Max

        • 1. Re: Incorrect Navigation from homepage
          kglad Adobe Community Professional & MVP

          what do you mean by, "..and click forward"?  what's forward?

          • 2. Re: Incorrect Navigation from homepage
            Max Borge Level 1

            My file is simulating a user flow through a web registration process. So forward is moving forward through the process one screen at a time.

             

            I have a button 'click1' that navigates forward.

             

            I have actually only have one 'back' button now. This is at the end of the process (the user is able to return to the beginning and register another account).

             

            The page navigates from the final screen to the first, and then forward correctly for a few screens and then jumps to the final page again.

             

            I am unsure why this is.

             

            Thanks

             

            Max

            • 3. Re: Incorrect Navigation from homepage
              Max Borge Level 1

              My file is simulating a user flow through a **linear** web registration process

              • 4. Re: Incorrect Navigation from homepage
                kglad Adobe Community Professional & MVP

                there are many ways to cause problems like this using as3.  the only sure way to fix the problem is to

                 

                1.  make sure your button listener code is on the first keyframe that contains your button.

                 

                2.  your button should be on its own layer

                 

                3.  that layer should extend to length of your timeline

                 

                4.  there should be no keyframe in your button's layer OTHER than the first keyframe.  ie, there's only one keyframe containing your button and your button exists throughout your timeline.

                 

                you should be able to confirm your button works correctly under that scenario.  after doing that, you can add keyframes to your button's layer to fix the design issues caused by following 1-4.  BUT, if you remove your button in one of those keyframes, you may break your button's code.  if you're tempted to remove that button, make sure you test immediately after removing so you can confirm that caused no problem.  if it did, undo that change.

                1 person found this helpful
                • 5. Re: Incorrect Navigation from homepage
                  Max Borge Level 1

                  Hi there,

                   

                  Apologies for the delay on responding to this post.

                   

                  Points 2-4 below are definitely addressed in my file.

                   

                  i.e. - The button is on it's own layer, with the layer stretching throughout the timeline on one uninteruppted keyframe.

                   

                  However I'm not sure about the 1st.

                   

                  There is listener code on every screen that the button navigates to, (to allow it to be navigated from)...

                   

                  Just to clairfy the issue, the file proceeds through 20 screens using the same 'next' button, to the end of the process. Once at the end, the code navigates back to the 1st page - which it does successfully - and then gets stuck there, meaning that the user is not allowed to view the file a second time without closing and re-opening.

                   

                  Any help you can provide form that info is much appreciated.

                   

                  Thanks