A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Taking control of the browsers back button...

  1. #1

    Red face

    Is this possible? I'm getting complaints from our page's users -- they're pretty pissed off it seems. They're not using the back buttons in the Flash movie; instead they're using the back buttons on the browser. When they do this they unload the movie and then have to start all over again, clicking like mad to get back to where they were before.

    I had an idea to break the movie up into little movies and use a .html for each movie, but that would be extremely painful! Any ideas?

    thanks,
    -philiestick

  2. #2
    Member
    Join Date
    Sep 2000
    Posts
    41

    Some things you could try

    You could try opening the swf in a separate window (with javascript), and making the menubar and such hidden. You could also make it full screen and include an "exit" button (so the user knows how to get out of the full screen).

    You could even use screen.height and screen.width to obtain user's screen dimensions....that would be useful since Netscape doesn't understand the "fullscreen" command.

    Other than that...if neither of those suffice your desires, you could try making the back button more noticeable. That's pretty much all there is I think... Unless... you could make the HTML in 2 frames...top frame being really, really thin, and the bottom one contain your flash. In the top one, put an HTML document that automatically calls another HTML document. That way, if the user hits back, it will cause the top frame to go back in history, and that page will automatically go to the page it was just in. Therefore the back button wouldn't really do much...unless the user were to hold the back button down with their mouse.

    Matthew J. Drollinger

  3. #3

    Re: Some things you could try

    All very good ideas. I'm liking the javascript one, since I can just take the back button out of there. Heh, that would definitely remove my problem.

    I'm curious about the screen.height and screen.width commands. Where could I use those, and how could I use those? Would I use those in conjunction with the height=xxx commands with Javascript?

    Also, if I use a javascript window.open to call the movie, do you know if I can open it maximized? I.e. I don't want to have to specify the height/width so that all screen sized would open it maximized: 800x600, 1024x768, etc.

  4. #4
    Member
    Join Date
    Sep 2000
    Posts
    41

    Re: Re: Some things you could try

    Originally posted by pwrstick
    I'm curious about the screen.height and screen.width commands. Where could I use those, and how could I use those? Would I use those in conjunction with the height=xxx commands with Javascript?

    Also, if I use a javascript window.open to call the movie, do you know if I can open it maximized? I.e. I don't want to have to specify the height/width so that all screen sized would open it maximized: 800x600, 1024x768, etc.

    In JavaScript, screen.width will return the horizontal screen resolution in pixels, and screen.height will return the vertical resolution. This would obtain a value you could write into the window.open height and width.

    Here is how to do this...just made this to show you how.

    <SCRIPT>
    <!--
    document.write("<SCRIPT>\n"
    + "window.open("
    + "'flashpage.htm','myFlash','width=" + screen.width
    + ", height=" + screen.height + ", directories=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizeable=no, fullscreen=yes'"
    + ");\n"
    + "</SCR" + "IPT>\n");
    //-->
    </SCRIPT>

    Hopefully the word wrap in here doesn't confuse you too much. I basically have JavaScript writing JavaScript into its containing HTML page.

    The fullscreen=yes will open the page fullscreen in IE. Otherwise, if using Netscape, a screen-sized window appears.

    Make sure you don't put the "</SCR" and "IPT>" together... They are apart so that it doesn't turn off the initial JavaScript code.

    Hope this helps.

    Matthew J. Drollinger

  5. #5
    Member
    Join Date
    Sep 2000
    Posts
    41
    By the way... 2 little notes to add.

    Make sure you include an exit button somewhere to close the window. Otherwise, in internet explorer, your non technical audience may think they have to restart their computer in order to close the window.

    Also...you may want to do a test for JavaScript in the first HTML page, which would tell a user that they must use a JavaScript enabled browser (if their JavaScript isn't already turned on).

    Matthew J. Drollinger

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