1 Reply Latest reply on Dec 11, 2008 11:19 PM by kglad

    help with actionscript to make page jump back to top

    mojoedemos
      Ok so I wanted the page to jump back to the top when the buttons are pressed. I found some help in an old thread. It worked great but for the first button only that i put the script on. All the others don't work at all. Even if its the same button just on a different frame. Not sure what i am doing wrong at all. I really don't know anything about actionscript so if anyone can please help me. Below is the script that i added to the tree buttons and the script i added to the html code.

      thanks- joe

      Button1:

      on (release) {
      nextFrame();
      import flash.external.*;
      flash.external.ExternalInterface.call('pageTop');
      }

      Button2:

      on (release) {
      gotoAndStop(1);
      import flash.external.*;
      flash.external.ExternalInterface.call('pageTop');
      }


      Button 3:

      on (release) {
      prevFrame();
      import flash.external.*;
      flash.external.ExternalInterface.call('pageTop');
      }

      At the top of my html:

      <head>
      <script http-equiv="Content-Script-Type" content="text/javascript">
      function pageTop() {
      window.scrollTo(0,0);
      }
      </script>