What is the best way to go about disabling the cache in google chrome for mac, so that when I am developing a flash application, it will bring in the new movie every time?
Please advise, I can't figure out how to ensure the version of the .swf I am looking at is the most recent version.
One solution might be to get the flex compiler to append a timestamp to the .swf filenames, is this possible?
Thanks!
Go to the 'View' menu, open Developer Tools. In the bottom right corner of the Developer Tools is a gear icon. Click it, then check the 'Disable Cache' checkbox.
In your embed code where ever you the swf file you have to put a random number or a time stamp of some sort on the query. Whenever there is a query string that changes the browser will not cache the page.
"MySWFName.swf?t=" + new Date().getTime();
Best method would be to embed your SWF using SWFObject with this code.
In the html body tag do this.
<body onLoad="loaded()" onunload"doUnload( )">
  <div id="replaceMe">Loading content.</div>
</body>
and for the javascript do this ( obviously changing the stuff wrapped in { } to your needs
<script type="text/javascript" src="swfobject.js">
<script type="text/javascript">
  function loaded() {
    var flashvars={}, params={}, attributes={}, tmp, version, width, height, container, flashObj;
    flashvars.userName    = "testvar";
    params.menu = "true";
    params.quality = "high";
    params.bgcolor = "${bgcolor}";
    params.allowscriptaccess = "always";
    params.allownetworking = "all";
    attributes.id = "${application}";
    attributes.name = "${application}";
    attributes.align = "middle";
    attributes.allowscriptaccess = "always";
    attributes.allownetworking = "all";
    tmp = "expressInstall.swf";
    version = "${version_major}.${version_minor}.${version_revision}";
    width = "${width}";
    height = "${height}";
    container = "replaceMe";
    flashObj = "${swf}.swf?t=" + new Date().getTime();
    swfobject.embedSWF(flashObj, container, width, height, version, tmp, flashvars, params, attributes);
  }
</script>
Don't forget to add a copy of SWFobject
You will never have caching issues again
EDIT:
BTW if you replace your code in your html.template.html file with this code it will generate the values for you. :)
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