2 Replies Latest reply on Sep 5, 2009 3:01 PM by deuce4

    Syncronization of Flex SWFs, or How do I clear the cached version?

    deuce4

      How can you force Flash to re-upload a new version of a .swf?

       

      I can compare the version running using a remote object call, but then how can I then in Actionscript force Flash to load a new file, rather than the one on the local computer?

        • 1. Re: Syncronization of Flex SWFs, or How do I clear the cached version?
          TheFlexGuy Level 2

          If I understand your issue correctly, it's a problem commonly had when dealing with loading config files or images.

           

          What I've done in the past is append an additional argument to the http call, so I add "&nocache=20090905101322" (number being todays date and time) to the call so that the browser assumes it's gathering dynamic data and what comes back will be different.  That might work for swfs too.

           

          -Marty [ http://www.theflexguy.com ] Helpful/Answered? Please mark it as such.

          • 2. Re: Syncronization of Flex SWFs, or How do I clear the cached version?
            deuce4 Level 1

            Actually, I had trouble using the nocache as it would just reload the Swf every time, rather than only on updates.

             

            But I think I have it figured out using the html wrapper.  SInce my clients access the wrapper, I just compile a new version with a different name, then rename the html wrapper to the original name.  Thus

             

            Originally in folder: MyProgram.swf, and MyProgram.html

            (users access MyProgram.html to load program)

            Recompile new version as "MyProgramV2", but then rename MyProgramV2.html as MyProgram.html

            Replace MyProgram.html on server, add MyProgramV2.swf, delete MyProgram.swf on server.

             

            Viola!  Seems to work.

             

            I don't really understand all the wrapper functions, so hopefully this will not cause any other problems.