7 Replies Latest reply on May 26, 2010 12:33 AM by dldawg

    button to open page in mainframe.

    dldawg

      I have read through several posts and threads on this subject and I'm still confused a bit. I have a flash menu that is working just fine. I want to put this menu into an existing web site that uses frames. I have tried two different action scripts and soon as I change the target to the mainframe, it all stops.

       

      The first script that I used I wrote with the help of the  Behaviors and it wrote this;

       

      ---------------------------------------------------

      on (release) {


      getURL("page_mainbody_about.html", "_blank");

      }

      --------------------------------------------------------------------------

       

      This worked fine and opened a new  window. I then changed the Target to _mainframe and it all stopped. Next went into the frameset and changed the name  to main and used these codes;

       

      ---------------------------------------------------------------------------

       

      on (release) {


      getURL("page_mainbody_about.html", "_main");

      }

       

      and

      ------------------------------------------------------------------------------------------ ----

      on (release) {


      getURL("page_mainbody_about.html", "main");

      }

       

      ------------------------------------------------------------------------------

       

      Last code I tried with the same failed results;

       

      loadButton.onRelease = function() {
      getURL("newPage.html","mainFrame");
      }

       

      ----------------------------------------------------------------------------

       

      Any suggestions on why soon as I change the target, why it all dies?

      I did check names and IDs on the frameset and  they match up with the target in the actionscript.

       

       

      Thanks

      Dale

        • 1. Re: button to open page in mainframe.
          kglad Adobe Community Professional & MVP

          show your frameset code.


          • 2. Re: button to open page in mainframe.
            dldawg Level 1

            Here is the frameset code;

             

             

            <frameset rows="80,*,137" cols="*" framespacing="2" frameborder="yes" border="2">
              <frame src="body_html/haec_banner.html" name="banner" scrolling="No" noresize="noresize" id="banner">
              <frame src="body_html/haec_navigation.html" name="nav" id="nav">
              <frame src="body_html/haec_mainbody.html" name="main" scrolling="Yes" noresize="noresize" id="main">
            </frameset>

             

             

             

             

            Thanks

            Dale

            • 3. Re: button to open page in mainframe.
              kglad Adobe Community Professional & MVP

              use:

               

              loadButton.onRelease = function() {
              getURL("newPage.html","mainFrame");
              }

               


               

               

              <frameset rows="80,*,137" cols="*" framespacing="2" frameborder="yes" border="2">
                <frame src="body_html/haec_banner.html" name="banner" scrolling="No" noresize="noresize" id="banner">
                <frame src="body_html/haec_navigation.html" name="nav" id="nav">
                <frame src="body_html/haec_mainbody.html" name="mainFrame" scrolling="Yes" noresize="noresize" id="main">
              </frameset>

               

               

               

               

              AND test online.

              • 4. Re: button to open page in mainframe.
                dldawg Level 1

                use:

                 

                loadButton.onRelease = function() {
                getURL("newPage.html","mainFrame");
                }

                 

                 

                I removed the code that I had and inserted what you provided and uploaded it to test folder under my own web site and it does nothing.

                 

                When I inserted the your code I added to the frame for each button I tested the code and its fine. Frame 1 for each bitton show the "a" for action for each button.

                 

                If I insert the code to the button I get the following error when testing the code:

                 

                 

                Scene=1, layer=home, frame=1, line1

                Statement must appear within on handler

                loadButton.onRelease = function() {

                 

                ----------------------------------------------------------------

                 

                I will try putting the code back to the button and testing again online...

                --------------------------------------------------------------------------------------

                 

                Still not working after placing the code back to each button.

                 

                Would I be better once its all complete and save it as a movie clip, ofr the seven buttons on a background?

                 

                 

                Thanks

                Dale

                 

                Message was edited by: dldawg

                • 5. Re: button to open page in mainframe.
                  kglad Adobe Community Professional & MVP

                  when i do exactly what i suggested you do, it works:  www.kglad.com/Files/forums/Untitled-1.rar

                  • 6. Re: button to open page in mainframe.
                    dldawg Level 1

                    I looked at your attached files (link) and I think I see how your making it work The file b.html is what your using as a button,

                     

                     

                    I started with a simple rectangle and convert to symbol save as a button. Edited the necessary areas and added key frames on up, over  and hit, no key frame on the down.  Back on the stage, I clicked on the button and inserted the  action script that you sent. Where I think I messed up is I did not give it an Instance name, but had the instance behavior as a button.

                     

                    I will look closely at your files to see where I screwed up and reply back once I figure it all out....

                     

                    Thanks Again

                    Dale

                    • 7. Re: button to open page in mainframe.
                      dldawg Level 1

                      Where I messed up even with your code was the lack of the instance  name. I did get 5 out of 7 to work. The last two are instance name and file name errors.....

                       

                      One last question on this, does the instance name need to be unique for each button or can all be named btn like you had in the example??

                       

                      Thanks again for your help! I feel like an idiot for messing the instance tag, I bet my original code may worked, Since what you supplied works, it will stay....

                       

                       

                      Take Care

                      Dale!