Loading shockwaves in IE

Argh what a horrible morning, fighting with the virus. It all had to do with this shockwave, it would not load properly in IE, not even version 7.

A quick search reveals that there is something called SWFObject that will overcome this problem. So I check the deconcept homepage and use one of the examples there but still nooo, it just won’t work. However YouTube seems to always get their shockwaves to load properly, how?

So a view source on the YouTube homepage reveals that they are using the SWFObject too, great! Their code is a little bit different though, they have an embed tag already inside the target div. Don’t ask me why. Anyway I put an embed tag inside my own div just like they do and voila! It worked in both IE6 and 7.

<div id="flashcontent_div" name="flashcontent_div" style="display: block;">
<embed type="application/x-shockwave-flash" src="mymovie.swf" id="flashcontent" name="flashcontent" bgcolor="#FFFFFF" quality="high" wmode="opaque" height="383" width="510">

<script type="text/javascript">
// <![CDATA[
   var fo = new SWFObject("mymovie.swf", "flashcontent", "510", "383", 8, "#ffffff");
   fo.addParam("quality", "high");
   fo.addParam('wmode', 'opaque');
  // ]]>

Related Posts

Tags: , , ,