10 Replies Latest reply on Aug 2, 2008 12:17 PM by kglad

    templates, buttons, and getURL

    german01 Level 1
      I created a navigation bar named Nav_2008 in flash, which is used as Navigation bar on a DreamWeaver template. A copy of Nav_2008 is on Template folder and root where the Index page is placed.

      This navigation bar has 6 buttons, each named for example, home_bt, history_bt, learning_bt, etc.
      On the timeline of Nav_2008 I have six labels corresponding to each button, home, history, learning, etc.
      The same buttons were copied, so that each label (history, learning,etc.) has it own set of buttons.

      Each button has the following actions:

      //to move to a label, history for example//
      on(press){
      gotoAndStop("history");

      }

      //to get the URL of the history page//
      on (release) {
      getURL("C://My Documents//Hisp_Lat_2008/Pages/History.html", "_self");
      }


      PROBLEM:

      The URL is loaded, but the navigation bar doesn't go the label "history"

      Keep in mind that Nav_2008 is used on a template and the URL loaded corresponds to a different page every time a button is clicked.

      Your help is always appreciated.

      German
        • 1. Re: templates, buttons, and getURL
          kglad Adobe Community Professional & MVP
          either your button is a movieclip buttons or there's no frame labeled "hostory" on the timeline that contains your button.

          and once you get your on(press) working, there's a good chance you're on(release) won't work. you can remedy that by removing your on(press) or your on(release) and putting both actions in the remaining hander.
          • 2. Re: templates, buttons, and getURL
            german01 Level 1
            Thansk for replying.
            0) Checked tha all URLs loaded = they all did properly.
            1) I reveiwed label names = all correct;
            2) I reviewed if buttons were instances of buttons and not movie clips = they are all instances of buttons.
            3) I dropped on(press) and left on(release) as follows

            on (release) {
            getURL("C://My Documents//Hisp_Lat_2008/Pages/History.html");
            gotoAndStop("history");
            }

            When history_bt is released, it should go to history label. This label doesn't have a history_bt. Instead a home_bt takes the place of history_bt.

            PROBLEM:
            When history_bt is pressed, you can see that home_bt appears (flashes), but doesn't stay. It goes back to history_bt.

            Does this happen because the Nav_2008 is used as a template? I believe that every new page loaded, shows the initial state of Nav_2008, which is where the history_bt is placed.

            What should be the proper way to handle this type of navigation bar?
            • 3. Re: templates, buttons, and getURL
              kglad Adobe Community Professional & MVP
              i have no way to know what "type of navigation bar" you're using. if that navigation bar has some coding that's affecting your issue, you need to find that coding.

              and i don't know what you're trying to convey about home_bt flashing, but if that means you are seeing the "history" labeled frame momentarily, you must have code elsewhere causing the playhead to move from "history" to another frame.
              • 4. Re: templates, buttons, and getURL
                german01 Level 1
                Kglad:

                Thanks for taking the time to reply.
                I checked all buttons and timeline and there is no other code.
                frame 1 - has stop();
                ALL BUTTONS HAVE AS2
                For example history_bt

                on (release) {
                getURL("C:\\My Documents\\Hisp_Lat_2008\\Pages\\History.html");
                gotoAndStop("history");

                }

                I hope this additional information helps to clarify my problem.
                The Nav_2008.swf is the navigation bar on a Dreamweaver template. All pages including Index (front page) have the same navigation bar.

                Nav_2008.swf has the following labels, for example:

                label home has history_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt

                label history has home_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt

                label hispanics has home_bt, history_bt, latinos_bt, learning_bt, and credits_bt (and etc.)

                When you preview the site on dreamweaver, Index page shows
                history_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt

                When you click and release history_bt you should be taken to history label with
                home_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt (no history_bt e


                history level because you can see the home_bt (which is placed under history label). However, 1 or 2 seconds later, Nav_2008 returns
                history_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt (which is the home label on Nav_2008)

                • 5. Re: templates, buttons, and getURL
                  german01 Level 1
                  Sorry, I didn't finish my last reply.

                  When you click and release history_bt you should be taken to history label with
                  home_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt (no history_bt

                  I said that when you click on history_bt, you see the home_bt for 1 or 2 seconds, but then the history_bt comes back again.

                  I hope my long explanation makes sense.

                  German.
                  • 6. Re: templates, buttons, and getURL
                    kglad Adobe Community Professional & MVP
                    does the timeline go to the frame labeled "history" for 1 or 2 seconds?
                    • 7. Re: templates, buttons, and getURL
                      german01 Level 1
                      Yes, you see the home_bt for 1 or 2 seconds, which means that timeline moves from home to history label; but then it goes back to home. It happens when you click any other button. It seems that timeline is moving to the right label, but it goes back to home label. I have a stop(); on the first frame of timeline (just to let you know).

                      I removed all the getURL from each button to test Nav_2008. It works well on both SWF and template. You move from home to history and any other label.

                      HERE IS WHAT I THINK HAPPENS
                      Because Nav_2008 is used as a template, all pages in this program have the template applied. The original state of Nav_2008 is home, so the buttons are
                      history_bt, hispanics_bt, latinos_bt, learning_bt, and credits_bt

                      Therefore everytime you load a new page, what you see is the original state. Don't you think?

                      So the question may be.

                      How to make Nav_2008 recognize which page has been loaded so that it moves to the right label?

                      Thanks for taking the time to reply and look at this issue.

                      German



                      • 8. Re: templates, buttons, and getURL
                        kglad Adobe Community Professional & MVP
                        then it does move to the correct label. so, there's nothing wrong with your code. again, there must be code elsewhere causing the problem.
                        • 9. Re: templates, buttons, and getURL
                          german01 Level 1
                          kglad:

                          I really appreciated your help. Unfortunately, I couldn't resolve the issue.
                          I re-did the entire Nav_2008, which is just a SWF that is inserted in a Dreamweaver template and then applied to all html as navigation bar.

                          - I changed all the buttons and inserted new ones from the library.
                          - I kept the same labels. Actually typed on the stage the name of each label so I could physically see the change from label to label.
                          - When used in Dreamweaver, I still see that Nav_2008 moves from one label to another, but after 1 or 2 seconds, it goes back to the home label.
                          My conclusion is that the code isn't wrong. But the way the SFW is being used doesn't allow Nav_2008 to move and stay on a different label.

                          Think about this, if it were just one page Nav_2008 would actually change from label to label without problems. However, when you click a button a new page is loaded. Everytime you load a new page Nav_2008 refreshes itself and goes back to home state.

                          I don't know how to handle this. If you have any other suggestions, I'll try and see what happens.

                          Once again, thank you very much for your assistance.

                          German
                          • 10. Re: templates, buttons, and getURL
                            kglad Adobe Community Professional & MVP
                            Nav shouldn't be reloaded. that's a problem with your setup.