Help with actionscript to make page jump back to top

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>

you don't need all the import statements but the problems are
likely caused by your buttons failure to exist when the timeline
goes to the frame indicated in the line above the externalinterface
call().

Similar Messages

  • Google search result page jumps back to top when opening a result in a new tab

    hello
    when searching from www.google.com, using 100 search results per page.
    i will scroll down the page, find a hit worth looking at, right click on it to open it in a new tab, and then immediately the search result page will jump back to the top.
    whereupon i will have to again scroll down to where i was to look a subsequent search results :-(

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Accordion makes page jump with SpryURLUtils

    Hi,
    To see my problem you need to reduce the depth of the browser
    window or click "Quick Contact" to expand the page. Then refresh or
    click samples 02.
    http://www.adelantedesign.co.uk/websites/adelante/Packaging/Packaging_Samples01.asp?panel= 1#Accordion1
    The problem is, it's like there is an anchor to the top of my
    Accordion Panel when the page loads it pulls the Accordion Panel to
    the top.
    Is there something I can change to disable this?
    Thanks for looking,
    Rich

    Hey there Rich i believe the issue is still happening in IE 7
    for your problem which is just like mine. I am hoping to figure out
    a way to stot the autoFocus from moving the page focus to the top
    of the Accordion Object.
    Anyone have any ideas on how to edit the JS to have this work
    properly?
    Thanks!

  • Opening any link causes location in current page to jump back to top of page.

    I have FF set to open all new windows in a new tab which was the default setting. Whenever I open a link, the new link will open in another tab, but on my current page/tab I will be transported back to the top of my current page/tab. You can imagine how annoying this is especially on long pages. Does anyone have a solution for this? One thing I have tried is highlighting some text near the link I am about to open and sometimes this will prevent the page from moving back to the top when I open the link, but not always. Thanks for looking, (FF 3.6.18 on linux)
    -This occurs whether I have FF set to switch immediately to new tab, OR not.

    Thank you Cor-el! That did the trick, but I'm not sure why.
    Just FYI I restarted in safemode, and chose to continue without selecting any of the options just as you said. I tried clicking on links further down in the page, and the page DIDN'T jump back to the top! I checked to make sure the default theme was selected which it already was.
    When I restarted Firefox in normal mode, it continued to do the right thing and did not jump to the top for each link open. I have no idea why your solution worked, maybe it reset something? anyways, thank you again, wonderful help!

  • Need help with an "exit door" page

    My office has a page on our webserver that serves as an "exit door". It basically tells you when you're leaving our site (they do this because it's a gov't site, and thus rquired) and you have to click on a link to confirm that you want to leave.
    The way it works is that when you code a page with a link that needs an exit door, you prepend the url with "exit.cfm?link=" and then the URL. It works adequately on simple URLS that pass no parameters. Where it has a problem is when a URL has GET arguments like ?page=23&item=43.
    The original coder used URL.link, which of course only captures the first GET argument. As a work-around, we're required to edit the target URLS being passed to the exit door and replace things like &amp; and # with [amp], [pound], etc. Needless to say, this gets rather tedious, so I decided to have a look at that old exit door page to see what I could do with it.
    After playing around a bit, I achieved  a reasonable level of success by using the following:
    #xmlformat(ListDeleteAt(CGI.QUERY_STRING,1,"="))#
    This gives me a properly encoded full URL to use as a link on the exit door page. But there's one problem. If there's a link that contains an anchor (like foo.com#section1) it doesn't capture the anchor. The # and what's after it isn't being passed.
    I'm trying to figure out how to make this work.  Has anyone else here had to make an exit door, and if so, how did you do yours?

    Thanks mack.  I'm starting to think the answer to this is "it can't be done".  Which is probably why my predecessor was replacing &amp;s with [amp]s.
    What led me to try to change this was that I was trying to build a regex for Dreamweaver that changed things like &amp; and # to [amp] and [pound], but only when the URL began with the exit door page URL.  I was only able to get my regex to replace one occurance of an item per pass, which sort of defeated its purpose.  So I decided to change the exit door page instead.
    Maybe I'll go back to trying to get the regex to work.
    Ian, thanks for your help as well.

  • Help with using a web page from disk after saved from web

    Hi, I almost forgot the little I learned about web page development, so, I'm a total noob when it comes to this and I need your help.
    I saved as a complete web page on my hard disk this web page but when I open it in Firefox or IE, it doesn't display as much as I need it. I'm mostly interested  in displaying the logo images as they appear on the original web page. The browsers just show them briefly when refreshing but hide them right away. I can see the image files downloaded to my hard drive and if I open the page in Dreamweaver it displays these images  in the preview pane but I can't make them show in the browsers. From Dreamweaver I saved the page as in the folder where the images are and this also updated the code with the relative image links but the browsers still don't show them.
    I will greatly appreciate your help with this.

    I'm sorry, but your post is very confusing
    I saved as a complete web page on my hard disk this web page
    Does this include site definitions?
    when I open it in Firefox or IE, it doesn't display as much as I need it.
    I dont know what this means...are there images that are not being displayed?  Is there styling that is not being rendered?
    . I'm mostly interested  in displaying the logo images as they appear on the original web page. The browsers just show them briefly when refreshing but hide them right away.
    Again, I dont know what this means?
    I can see the image files downloaded to my hard drive and if I open the page in Dreamweaver it displays these images  in the preview pane but I can't make them show in the browsers. From Dreamweaver I saved the page as in the folder where the images are and this also updated the code with the relative image links but the browsers still don't show them.I will greatly appreciate your help with this.
    Do you have a link to the page, and perhaps some explanation that is more clear as to what your issue is.
    Gary

  • Page down/scroll in iTunes store jumps back to top of page

    I can't scroll/page down in the iTunes store without it jumping back to the top of the page after about 1 second. Tried using keyboard arrows/page down, mouse click/drage scroll bar, mouse scroll button. Just downloaded the latest update but didn't fix problem. Any ideas?

    I also have had the same problem for months now. The updates do not fix the problem. Is there anyone out there with an answer?
    Sometimes out of the blue I will click somewhere on the itunes store screen and it will stop doing it but, I can't repeat it the next time I open Itunes. It always just wants to stay scrolled all the way to the top on every itunes store page.

  • Re-Tweeting in Twitter makes Feed jump back several tweets back or to beginning of feed.

    After opening eight links from my Twitter Feed, Firefox jumps back towards the previous 10-15+ Tweets that I previously viewed, I am using nightly (21.01A 2013-01-30) and in previous revisions it was much worse, like in 17.01 it would refresh the Twitter Feed
    This Behavior does not occur in any other "Major" Browser for Linux, but this is not specifically Platform "agnostic" as it happens on ubuntu, arch, opensuse ,Gentoo, even the more "Enterprise" oriented distro's such as FreeBSD and RHEL
    As I have them on all different machines, using the above mentioned OS'es
    Also, to add I see that I am getting(as another certain poster in this forum) the dreaded "your Twitter account is not allowed to perform this action" in Firefox, but it only seems to be for certain Random Retweets I attempt...

    You are using Firefox Nightly, we don't have much people that specialize in it. You can try clearing cache and cookies and resetting Firefox but if that does not work I would suggest reporting a bug. Here are the steps;
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Create an account if you don't have one already and report your bug here: https://bugzilla.mozilla.org/ but please do the above before reporting.
    Thanks!

  • PLEASE HELP: Need some help with coding a next page button.

    so ok, in details, I'm trying to code a next page button and can't really figure out how and tried to look for them over the net but can't find the kind I am looking for. So ok, the kind of next page button I'm looking for is the kind where you have like << 1 2 3 4 5 ... (Next page button) >> not just a button where I need to hyperlink it to the next page url cuz I have like 35 pages to put... so I'm trying to figure it out yet no cigar so can someone please help me with this? Thanks!

    What I've seen done a lot (on forums with upwards of 1000 pages on some threads) is to add a "pagination" block of code that has:
    two or three pages before the current page
    two or three pages after the current page
    a drop down with ALL pages listed
    The "next" link or button is then just a copy  of the final link in the inline list.
    Something like this:
    <table>
    <tr>
    <td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>Goto page <select name="generate_pagination" onchange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }"><option value="forum-page-26.html" selected="selected">1</option><option value="forum-page-26-45.html">2</option><option value="forum-page-26-90.html">3</option><option value="forum-page-26-135.html">4</option><option value="forum-page-26-180.html">5</option><option value="forum-page-26-225.html">6</option><option value="forum-page-26-270.html">7</option><option value="forum-page-26-315.html">8</option><option value="forum-page-26-360.html">9</option><option value="forum-page-26-405.html">10</option><option value="forum-page-26-450.html">11</option><option value="forum-page-26-495.html">12</option><option value="forum-page-26-540.html">13</option><option value="forum-page-26-585.html">14</option><option value="forum-page-26-630.html">15</option><option value="forum-page-26-675.html">16</option><option value="forum-page-26-720.html">17</option><option value="forum-page-26-765.html">18</option><option value="forum-page-26-810.html">19</option><option value="forum-page-26-855.html">20</option><option value="forum-page-26-900.html">21</option><option value="forum-page-26-945.html">22</option><option value="forum-page-26-990.html">23</option><option value="forum-page-26-1035.html">24</option><option value="forum-page-26-1080.html">25</option><option value="forum-page-26-1125.html">26</option><option value="forum-page-26-1170.html">27</option><option value="forum-page-26-1215.html">28</option><option value="forum-page-26-1260.html">29</option><option value="forum-page-26-1305.html">30</option><option value="forum-page-26-1350.html">31</option><option value="forum-page-26-1395.html">32</option><option value="forum-page-26-1440.html">33</option><option value="forum-page-26-1485.html">34</option><option value="forum-page-26-1530.html">35</option><option value="forum-page-26-1575.html">36</option><option value="forum-page-26-1620.html">37</option><option value="forum-page-26-1665.html">38</option><option value="forum-page-26-1710.html">39</option><option value="forum-page-26-1755.html">40</option><option value="forum-page-26-1800.html">41</option><option value="forum-page-26-1845.html">42</option><option value="forum-page-26-1890.html">43</option><option value="forum-page-26-1935.html">44</option><option value="forum-page-26-1980.html">45</option><option value="forum-page-26-2025.html">46</option><option value="forum-page-26-2070.html">47</option><option value="forum-page-26-2115.html">48</option><option value="forum-page-26-2160.html">49</option><option value="forum-page-26-2205.html">50</option></select>  <b>1</b>, <a href="forum-page-26-45.html">2</a>, <a href="forum-page-26-90.html">3</a> ... <a href="forum-page-26-2250.html">51</a>, <a href="forum-page-26-2295.html">52</a>, <a href="forum-page-26-2340.html">53</a>  <a href="forum-page-26-45.html">Next</a></b></span></td>
    </tr>
    </table>

  • The app "alarm clock with pandora radio" does not work and i cant get any help with it i want my money back

    I have tried to get info on this app and it does not show up on the app store any longer so i cant contact the developer about this app for support. it does not work and i feel i was cheated out of my money for an app that was supposed to play pandora when the alarm goes off but it does nothing. i need help with this.

    As stated All purchased are final.
    Use the e-mail receipt to Report a problem or
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • How to make page to go on top?

    I have a long jsf page. I want page to go top when there are any errors on the page. I am using <h:messages to display the errors on the top of the page but I am not able to make the page to goon top. HELP

    I think I need to explain the problem much more clearly. We have org.apache.myfaces.AUTO_SCROLL is set to true. That is causing the page to stay at its location. We are also using ajax4jsf. With a4j:commandButton and navigation rule I can make paget to go on top on error and stay on the same place when there are no errors. BUT we also have help files that can be downloaded and user can attach and download any files. Everything works fine until user clicks button to view the help files or attached documents then click on the button which is a4j. a4j button once again call the actions for viewing those documents. We have narrowed downed to a4j:commandButton so we want to get rid of a4j and just stick to h:commandButton

  • Multiscreen HTML5 TOC Jumps back to top

    Hi all,
    Using Multiscreen HTML5 (RH 11.0.0.179) if you click on a table of contents entry towards the bottom of the list, the ToC jumps back to the top of the ToC, so you have to scroll back down to see the selected topic and other topics around it.
    We've modified the skin so the ToC pane is a fixed height and has a vertical scroll bar.
    Is there any way to make the ToC stay down the bottom where the selected topic is similar to the Webhelp ToC? Or make make the selected topic display at the top of the ToC pane?
    Thanks,
    Amber

    Not really. The problem is that the whole page reloads when you're using Multiscreen HTML5. And the TOC doesn't really allow you to jump to a location half way when the page loads.
    This issue is fixed in Responsive HTML (RH11.0.3+). So if you can switch to Responsive, your problem would be fixed.

  • Screen jumps back to top of the report when a tab is clicked

    Hello everyone.
    I have a report that displays quite a lot of information and has a lot of tabs.
    Now on my work monitor everything fits on the screen fine so there's no problem.
    When someone with laptop (smaller screen) uses the report they have to scroll down to view everything which is fine. The problem is when they scroll down and click on a tab, the screen shoots back up to the very top of the report and the user has to scroll back down again.
    Hopefully I explained that well enough.
    Is there anything I can do to get the screen to not move when they select a tab?
    Thanks for any help on this.
    Kieran

    One last bump!
    Thought it was possibly a problem with the curser focus always being at the top of the screen, but changing that didn't seem to do anything.
    Anyone got any ideas at all?

  • Page jump always to top in iTunes store on a 20" iMac

    I use iTunes on my Macbook Air and everything works fine.
    Last week i bought a 20" new iMac and when I'm inside the iTunes store I can not scroll to the end of the page because every few seconds the page "jumps" automatically at the top.
    Can anyone help on this ?
    Thank you in advance

    it's not your mac, it's itunes... c'mon apple, fix this! It's been doing it for me on windows for 3 versions.

  • Why does Safari (version 7.0.6) startup page switch back to top sites?

    I have tried setting preferences, under the General Tab, to have new windows open with Home Page, which works fine so long as I don't quit Safari. However, whenever I quit Safari and then relaunch it (i.e., every time I restart my computer), the default setting changes back to Top Sites.

    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Preferences/com.apple.Safari.plist
    Right-click or control-click the highlighted line and select  
              Services ▹ Show Info in Finder (or just Show Info)
    from the contextual menu.* An Info dialog should open.
    ☞ Does the dialog show "You can read and write" in the Sharing & Permissions section?
    ☞ In the General section, is the box labeled Locked checked?
    ☞ What is the Modified date?
    If you don't have read and write access to the item, change the settings as directed here. Note, however, that if one file has wrong access settings, most likely others do as well. If the item is locked, unlock it.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

Maybe you are looking for