Entry

Aug02

One More IE “Problem”

There is not a week that goes by that I don’t find something new that is irritating with IE. It’s almost as if the program was begging to be made into a repeating column. Not that I would, but it’s very well pausible that someone has or could.

This week’s irritation? Flash caching. I’ve known about this problem for a while. It was actually one of the first things I was told to look out for when I started at Alienware. What I found recently is the bug that creeps up when IE caches a flash file embeded with the base parameter. And it was hard to notice when I started doing my development of a certain flash app because the first time IE loads the page, the flash will show exactly as it should. The bug only comes out once the page flash have been cached because anything loaded using relative pathing will cease to load.

The first time I saw it I freaked out. But as I started to debug the issue, it dawned on me what was happening. It looks to me that only the original flash and page are being cached, nothing loaded dynamically afterwards. I’m guessing that once IE sees the flash is cached, it runs the local copy, which then can’t find any of the relative files. Isn’t IE great?

There is an easy way to solve this though, and it’s the same one used to keep the flash from caching in the first place: make it random! The url of the flash movie that is. Add a with a random number generator to the query string end of the url and you’re set. If you use SWFObject to embed your movies you can use the following as an example:

<div id="flash"></div>
<script type="text/javascript">
//<![CDATA[
   var date = new Date();
   var strURL = "http://www.yourdomain.com/path/to/you/movie.swf?ra=" + date.getTime(); 

   var so = new SWFObject( urlstr, "demo", "width", "height", "flashver", "background-hex" );
   so.addParam( "base", "http://www.yourdomain.com/base/relative/path/for/swf/" );
   so.write( "flash" );
//]]>
</script>

You can just add a timestamp in the query string to be guaranteed that everytime you visit the page IE will load all movies, not just the one that is embedded.

August 2, 2006 08:42 PM HTML and CSS

Comments

Leave a comment of your own

If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.

Use of HTML for comments is not available.

In an effort to combat spam, you will be able to post your comment after you preview.





Powered by Movable Type 3.2 Creative Commons License: Some Rights Reserved © 2000-2005

Site feeds. Hofully valid XHTML and CSS. No kitties were harmed in the making of this website.