Forum Moderators: open
I had to find a way that would work with old versions of Safari - the usual Satay method <object> + <embed> wasn't working, and it bunged up IE7 with the "click to activate" embed patent stuff.
SWFObject is a javascript replacement technique that basically works like this:
1. Attach the SWFObject javascript to your page.
<script type="text/javascript" src="swfobject.js"></script> 2. Put your alt content in a <div> tag with a unique ID (you can use scripting to generate a unique id if you need to loop through flash results)
ex.
<div id="unique_id">
here is my search-engine friendly alt content
</div>
3. Paste the javascript into your page, and customize it to suit your SWF:
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "200", "100%", "7", "#336699");
so.addParam("quality", "low");
so.addParam("wmode", "transparent");
so.addParam("salign", "t");
so.write("unique_id");
</script>
the so.addParam items are if you need to add FlashVars to your content - a nice way to pass simple variables without using XML.
Make sure your IDs match!
<div id="unique"> and so.write("unique");