dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [F5] Back to Top Button

  1. #1
    Heartfelt Flash
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3

    [F5] Back to Top Button

    Back to Top Button - Is this possible in Flash V5? I am hoping to find a way of offering viewers a click opportunity to return them to the top of a webpage in SWF, embedded within an HTML template. ie. to move the browser settings. If such a thing is possible, I am assumming some kind of JavaScript communication with the browser will be required. My knowledge here is hazy, to say the least. The answer to this has elluded me for some time now. Any guidance would be gratefully received.

    Regards, Amanda.

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Flash 5? Im not sure..I fairly certain you can call JavaScript to move the BROWSER scrollBar to a certain position (position = 0)

    but You'll have to search here for the correct way as it has been asked and answered beofre.. however Im not sure if this can be applied to Flash 5.

    but what you can try is this maybe:

    Code:
    on (press) {
        getURL("javascript: window.scrollTo(0,0)");
    }
    or
    Code:
    on (release) {
        getURL("javascript:window.scroll(0,0)");
    }
    not sure which one has the correct syntax right now..

  3. #3
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    hi..I just tried (using Flash 8 though) with the FIRST example.. I made a BLANK movie made it 1200 pixels LONG...put a button at the bottom, with this code:

    Code:
    on (press) {
       getURL("javascript: window.scrollTo(0,0)");
    }
    worked fine..

  4. #4
    Heartfelt Flash
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3
    Thanks for your efforts whispers. I've tried with your suggested scripts and variations, but to no avail, as yet. I know I ought to be more up to date than Version 5. I am encouraged by your suggestion to search the boards. I did try doing this in General Help, but I shall investigate further.

    With thanks, Amanda.

  5. #5
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    what browser are you trying this in?

    I just created this using Flash MX.. exported to FlashPlayer 5 and saved in Flash 5 .fla format.

    Confirmed working in both FireFox and Internet Explorer..
    Attached Files Attached Files

  6. #6
    Heartfelt Flash
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3
    Thanks for the time you're putting into resolving my problem whispers. I've tried your movie, opening it in Explorer 6, on Windows XP. with a Flash 9 player. Still no joy I'm afraid. I tried altering some of the Java related advanced settings in Explorer, but still no joy. Is my browser to old perhaps? Meanwhile I continue to search the boards. I'm half way through ActionScript Help so far.

    Yours gratefully, Amanda.

  7. #7
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    ahh.. well you did NOT say Flash plaer 9 before.. (did you?)..

    you may try to use the ExternalInterface method() to call your javaScript instead..

    this may help aleiviate the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center