0 Replies Latest reply on May 5, 2009 10:27 AM by Forest|Rain

    URL link on button is not working when uploaded.

    Forest|Rain

      Hello,

       

      I have looked all over the web to try to find an answer to my problem and have had no luck.

       

      I have about 9 different buttons in a flash file that link to URLs within the same website where the SWF file is.  I have coded these buttons in both ActionScript 3.0 and 2.0.

       

      This is the code I used for each of the buttons in the ActionScript 3.0 version:

       

      function pageOne(event:MouseEvent):void

      {
          var url:String = "http://www.whatever.com/index.php/page1";
          var request:URLRequest = new URLRequest(url);
          try {
          navigateToURL(request, '_self');
            } catch (e:Error) {
          trace("Error occurred!");
            }
      }

       

      //register buttons
      pageonebtn.addEventListener(MouseEvent.CLICK, pageOne);

       

       

       

       

       

      This is the code I have used for each of the buttons in the ActionScript 2.0 version:

       

      on (release) {
          getURL("http://www.whatever.com/index.php/page1");
      }

       


      Now, I don't get any errors on either version.  I upload the SWF file to the server and then visit the page its on through my web browsers (Firefox, Explorer, Safari, Opera).  When I click on a button, it works.  It goes to the specified page that it should. 

       

      Then all of a sudden, I just click to go to another page, refresh the page, or even hit the back or forward buttons on the browser and then the whole SWF file brakes.  None of the links work.  All the animation works but not the buttons. 

       

      I have been pulling my hair out trying to figure this out and it really starting to drive me crazy.

       

      I want to say I really miss ActionScript 2.0 but it doesn't make a difference which version of ActionScript you use.  So this is leaving me to believe there is something wrong with the Flash Player.

       

      Any suggestions or solutions?????  Please help!!!

       

      Thanks,

       

      Shannon