SWFObject, valid embed flash animations
This article is dealing with the version 1 of SWF Object, for version 2 explaination please visit this page:
www.yoursiteisvalid.com/swfobject-update-embed-flash-version.html
In the last article, Alternatives for images and flash animations, we have discussed how to provide solution for users who don’t view important images or flash animations.
You might have seen the tags <object> and <embed> when you work with flash for your websites. Those two tags are needed if you want your animation to work for all major browsers. Unfortunately, <embed> is not w3C valid. Quite annoying when this is the only thing that keeps your website from complete validation.
Here is the solution: SWFObject
SWFObject is a Javascript class used for embedding Flash content. The script detects your users’ flash plug-in and is designed to make embedding Flash movies as easy as possible. It is also search engine friendly and degrades gracefully when javascript is not activated.
How to use it:
First you need to include the javascript file:
<scritp type="text/javascript" src="js/SWFObject.js"></script>
Then create a container for your animation in html and give it the id “fashContent”. (the id can be changed into whatever you want but don’t forget to change it in the following script)
<div id="flashContainer">alternate content should be placed here...</div>
Finally call the main function of the SWFObject:
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>
This script is used by all the most famous websites using flash like youtube, google video, etc… and is the best way, from my point of view, to deal with flash validation and accessibility issues. Have a look at the website for more info on the script: http://blog.deconcept.com/swfobject/


