2 Replies Latest reply on Aug 26, 2009 11:52 AM by msakrejda

    Versioning of a flex application


      I am invoking a flex application by embedding the swf in an html. Each time I update my Flex code at the server, how do I make the browser understand that it should get the latest code, i.e the latest swf file? In otherwords how do i version my flex application and reflect that in the html code to force the flash player download the latest code.

      How should i approach to solve this issue. Please suggest if there are any other way out.

      Thanks in advance.

        • 1. Re: Versioning of a flex application
          babo_ya Level 3



          I had found couple solutions for example, changing the html meta tag or .. whatever other methods..


          I tried all those and they actually didn't work. Might work for some case but, not all the time when you get like.. security and all those stuffs involved.


          The best solution I would suggest is renaming the .swf file & make sure you do find/replace on the hosting HTML page.


          hope this helps,



          • 2. Re: Versioning of a flex application
            msakrejda Level 4

            We have an ant target that post-processes the HTML wrapper and appends a version string. In the call to AC_FL_RunContent, we have


                "src", "main?version=" + (("@version@" == "SNAPSHOT") ? new Date().getTime() : "@version@"),


            and then we replace the token '@version@' with the actual version (or, if this is a snapshot build, with the current time as of the request), so we never get stale data from the cache, but we avoid bypassing the cache altogether for release builds. We run this as part of running mxmlc and it works reasonably well. We could probably be smarter about snapshot builds (e.g., take the checksum of the file bits, although this specific trick doesn't really work with .swf since I believe two builds of the same source in the same environment can produce different binaries based on build time).


            Maciek Sakrejda
            Truviso, Inc.
            Truviso is hiring: http://www.truviso.com/company-careers.php?i=87