Is there anyway in a flex application to figure out (in runtime) when the running swf was compiled?
I'd like to compare this with the latest file version of the swf on the server and detect if there's a newer version on the server and if so force the user to reload their browser to get the new version.
I need this to also work with swfs from the cache.
What I normally do to make sure the user gets the latest version of a Flash file (because there is something weird with the caching of Flash content) is to use a serverside script to append the time the file was changed.
I've also been experimenting with setting variables in the swf, although that requires some command line trickery and won't really be practical if you're not using a build script.
Basically you append this to your mxmlc call:
-define+=BUILD::DATE,"2008-12-10"
Then the variable BUILD::DATE will be available during your build, so you can use that to set at static variable which you later read:
private static var COMPILEDATE:String = DATE;
(I wrote all this from memory so it might not be 100% correct syntaxwise)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With