Skip navigation
mirolechat
Currently Being Moderated

Problem with swf breaking after using Firefox back button

Oct 7, 2011 2:39 PM

Tags: #firefox #geturl #back_button #swf_freeze

I have a problem with my swf freezing after navigating to it using the back button in Firefox 7.0.1 (mac) My swf has a set of buttons that link other non flash pages in the site. If you use the back button to navigate back to the page containing the SWF, the swf freezes. As far as I can tell it works on all other browsers and works on firefox on the PC.

 

you can see it in action here

 

www.psp.wa.gov/vitalsigns/

 

oddly if you use the html navigation and the hit the browser back button the SWF works fine. The bug only happens when using the swf.

 

help!!! Please!!!

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 8, 2011 11:51 AM   in reply to mirolechat

    use a preloader swf to load your main swf.  when loading your main swf, append a random query string to prevent your swf's retrieval from the browser cache.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 10, 2011 12:34 PM   in reply to mirolechat

    are you using setInterval() or setTimeout?

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 10, 2011 1:19 PM   in reply to mirolechat

    check for bug reports to see if this is a known ff7/mac issue.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 10, 2011 3:45 PM   in reply to mirolechat

    what's your url?

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Oct 11, 2011 11:07 AM   in reply to mirolechat

    you're welcome.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2011 10:34 AM   in reply to mirolechat

    I'm having a similar issue with firefox and the back button. The flash version of my site just links together html pages with swf movies. After the back button is pressed, none of the buttons will work (sometimes, just a blank page). I've found that it is not a problem in other browsers as well as earlier versions of firefox; where the site works perfectly. The site is unfinished, but I've been stuck trying to remedy this for a week.

     

    http://www.starnavigation.ca/Main.html

     

    I'm looking for any new information on this issue.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 24, 2012 12:02 AM   in reply to mirolechat

    A work-around that you can try is:

     

    Once the Flash loads have it check the browser's user-agent, if the browser is Firefox then call a JavaScript which shifts the focus off of the Flash and onto some other DOM object, such as a link or an input field.

     

    Example Script for in the Flash

    var ua:String = ExternalInterface.call("window.navigator.userAgent.toString");

    if(ua.indexOf("Firefox") > -1)

    {

      ExternalInterface.call("firefoxFlashFix");

    }

     

    Example JavaScript for on the Page  (Note: This uses jQuery, but it doesn't have to.)

    <script type="text/javascript">

              function firefoxFlashFix(){

        // set the focus to something other than the Flash

        $(".myLink").focus();

              }

    </script>

     

    I hope that works for you, it did for me. ^_^

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2012 5:16 PM   in reply to mirolechat

    Im having the same problems that you had did fix your problem and if so how?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 3:59 PM   in reply to jjcharles

    I've switched the way I embed the swf twice since I've noticed the problem. This works for firefox...

     

    <script type="text/javascript" src="swfobject.js"></script>

    <script type="text/javascript">

         swfobject.registerObject("myId", "9.0.115", "expressInstall.swf")

    </script>

     

    <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="925" height="1500">

    <param name="movie" value="FullTop.swf" />

    <object type="application/x-shockwave-flash" data="FullTop.swf" width="925" height="1500">

     

    You can try it on my site: http://www.star-navigation.com/

     

    You can find how-to and other info here: http://code.google.com/p/swfobject/

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 25, 2012 9:16 AM   in reply to mirolechat

    After encountering, and reading about this issue extensively, I have found a work-around for the Firefox Back Button/Flash-based Link incompatibility.

     

    Apparently, Firefox uses a Back-Forward Cache (bfcache) to store the state of all web pages in the current session's history. You must disable this state-caching for your particular page, by embedding this JavaScript in the body of your HTML wrapper:

    <script type="text/javascript">

         window.onunload = function(){};

    </script>

    I have tested this for OSX Firefox 15.0.1 and Flash Plugin 11.4.402.265.

     

    Source: http://stackoverflow.com/questions/2638292/after-travelling-back-in-fi refox-history-javascript-wont-run

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points