Flash Preloader with a cache workaround. So you want to update your Flash file and have it show up on the net? I went through major pain! Nobody really had what I needed, so I grabbed from multiple sources, as I usually do, and made my own solution. Flash files get cached in your temporary internet files. What is that good for? Great if you do not change your content ever. If you change your content, you are stuck with a cached file where people never see the updated information. Secondly, if you use a Preloader, that may not work either. I can't remember every detail, but I can tell you that it was a work of art in my eyes to see it work!
I embedded this code into the webpage to be able to run script and call the Flash file while generating a random number so the computer will not find it in the temporary internet files. Insert it wherever you want:
<script type="text/javascript">
<!--
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="366" height="299" align="right" class="par_padding">');
document.write('<param name="movie" value="Your File.swf?r=' + Math.round(Math.random() * 99999) + '">');
document.write('<param name="quality" value="high">');
document.write('<embed src="Your File.swf?r=' + Math.round(Math.random() * 99999) + '" width="366" height="299" align="right" quality="high" class="par_padding" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>');
document.write('</object>');
//-->
</script>
Next, this is placed in the first frame of the Action Script. You have to include the Security code as well, otherwise some message comes up. Then again, it might work just fine for you:
System.security.allowDomain("http://Your Website.com");
loadMovie("http://Your Website.com/Your File.swf?r="+ Math.round(Math.random() * 99999) + getTimer(), _root.Pictures_mc);
The timer is a standard Flash function that gets the amount of time in milliseconds that the file has been running. Thus, you get a pretty darn random number. ENJOY!
|