1 Reply Latest reply on Oct 8, 2010 4:05 PM by Ned Murphy

    can't navigate to home page anymore


      I have 10 buttons for various pages on a website I am building. I am only dealing with the first 2 buttons so far: home and about (laborLaw). On my about page, I wanted to have buttons to navigate to another frame where the viewer can Read More Details. Thanks to Valero, he showed me that in order to get my button to work, I had to type  about_mc. before the event listener of that button. Here's the code that worked.


      about_mc.laborLaw1_btn.addEventListener(MouseEvent.CLICK, laborLaw1);

      function laborLaw1(evtObj:MouseEvent):void{


      TY Valerio.


      So I am now able to navigate to frames from buttons inside the mc. My next task was to build a close button to navigate back to the about page from the "Read More Details" page on a 101. Here's the code I used on frame 101:



      // the following is to navigate back to "about" (Labor Page)


      closeLabor1_btn.addEventListener(MouseEvent.CLICK, returnLabor);


      function returnLabor(evtObj:MouseEvent):void{




      That worked great BUT, once I navigate BACK to the about page using the closeLabor1 button, I am no longer able to navigate to any other button such as the home button. Hmmmmm......


      Here's a video showing exactly what happens.


      http://www.screencast.com/users/happyggv/folders/Jing/media/fa6092ff-e 091-4856-865f-55b53088a669


      The above is a link to seeing the problem in live

      action video. Hope I have explained this appropriately for you to make a

      determination about what I have done wrong. TY SO MUCH Gene

        • 1. Re: can't navigate to home page anymore
          Ned Murphy Adobe Community Professional & MVP

          It sounds like you navigate away from where the movieclip of buttons is on the timeline, which essentially cancels any code that was assigned for them.  When you go back to to where they are, they don't work because the code for them is assigned in a frame that you would need to visit first, such as frame 1 or something.


          One way to solve this is to keep that movieclip present throughout the timeline and if it needs to not be visible at some point, then make the movieclip invisible (about_mc.visible = false).  That way, the code that was originally assigned to it will stay assigned and when you return to the frame you just have code to make it visible again there.