2 Replies Latest reply on Jun 8, 2010 8:38 AM by kgui-yG5PVz

    Why is flash reloading, reinitializing using the webbrowser back and forth button

    kgui-yG5PVz Level 1

      I have a Flash application running in a webpage. When this HTML webpage is loaded, a window.onload() javascript function is executed. And the Flash application is started bij initializing itself. This is the normal web application behaviour!

       

      But when a user is using the webbrowser BACK button (previous webpage), to goto the previous webpage. Followed by the webbrowser FORTH button (next), jumping to the original Flash application page, something strange happens.

      Javascript window.onload() is not executing, because the page was already loaded into the system. Which is the correct behaviour! But WHY doesn't Flash work in this way? Because the Flash application is reinitializing itself, doing everything again in the initialisation stage. Showing the intro, downloading external data, etc.

       

      How can I tell Flash, just keep playing the movie as is, when the user uses the BACK- and FORTH webbrowser button.

        • 1. Re: Why is flash reloading, reinitializing using the webbrowser back and forth button
          PJSB_DK Level 3

          Hi

           

          ??? I don't get it.???

           

          You leave the page and expect flash to keep working??

           

          The page loads to the system's cache, yes...But how on earth

          should flash continue to work, when the user leaves the page, which

          contains the swf file??

           

           

          Regards

          Peter

          • 2. Re: Why is flash reloading, reinitializing using the webbrowser back and forth button
            kgui-yG5PVz Level 1

            Ofcourse you are right! When the page isn't displayed anymore, the Flash object doesn't exist and stopped running! But also the HTML-code doesn't exist anymore.

            So why isn't JavaScript window.onload() fired when the user is going back to this page, using the nextpage webbrowser button. The page didn't exist!

             

            I know the webbrowser is retrieving the page from the CACHE, without firering the window.onload(). Because the CACHED copy contains everything, just before you left the page. Even dynamically generated HTML content. Why doesn't this apply to the Flash application. I would expect some sort of function here. like flash.onload(). Which is fired when loading the flash, and NOT fired when retrieved from the CACHE.

             

            In my JavaScript window.onload() there are things prepared which Flash needs.

             

            window.document["flashapplication"].SetVariable(action);

             

            But these preparations are gone after using these navigation buttons and the Flash application will fail. Ofcourse I can put the webpagine on the NO_CACHE state but then the user needs to load the complete Flash everytime.