Uncategorized

How-to embed Flash using SWFObject.js

Due to the Eolas/Microsoft patent problem, object tags (including Flash objects) will show a grey border around it, with a message to click to ‘activate’ this. This is a super annoying problem and has been addressed in multiple ways. I wanted to discuss one of the options/methods that works well for me.

First here is a great link to more information about the Internet Explorer bug

Due to the Eolas/Microsoft patent problem, object tags (including Flash objects) will show a grey border around it, with a message to click to ‘activate’ this. This is a super annoying problem and has been addressed in multiple ways. I wanted to discuss one of the options/methods that works well for me.

First here is a great link to more information about the Internet Explorer bug

Second, I would strongly advise you to download the SWFObject.js script here

Here is how you’d include your .swf file:

<script type="text/javascript" src="lib/swfobject.js"></script>
<div id="flashcontent2">
Please Download Flash Plugin to view the team.
</div>
<script type="text/javascript">
var so = new SWFObject("flash/yourSWFFile.swf", "mymovie", "520", "400", "7", "#ffffff");
so.write("flashcontent2");
</script>

This code works absolutely great (for now) assuming that Internet Exploder doesn’t change anything in the near future. The code basically writes the <object> tag in the browser, rather than the browser reading the HTML code.