Embedding XHTML-Vaild Flash
Filed Under: WordPress
Although I tend to stay away from flash there are times when you may want to use it in your site. According to Adobe the proper way to embed a flash object in an HTML document is,
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="myFlashMovie.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
The problem with this is it’s not XHTML valid. The embed tag is something invented by Netscape and never was a part of the W3C specs. Fortunately there is a way to properly embed flash so that it does validate,
<object type="application/x-shockwave-flash" data="myFlashMovie.swf" height="400" width="550"><param name="movie" value="myFlashMovie.swf" /></object>
Isn’t that much nicer? Alternatively you may wish to use a plugin for your WordPress site. The Kimili Flash Embed plugin will automagically embed valid flash objects in your document via the use of its special tag,
[kml_flashembed movie="/path/to/your/movie.swf" height="300" width="300" /]



6 Comments so far. Click here to join the discussion!
Dennis
Thanks, dude! I’ve been looking for something nice ‘n’ simple like this for a while but never quite got around to it…
Mar 1st, 2008
Len Kutchma
You’re most welcome Dennis.
Mar 1st, 2008
steve fox
It doesn’t work in FireFox
May 8th, 2008
Len Kutchma
Thanks for the input Steve. I haven’t actually tested it using Firefox.
May 9th, 2008
Nick Pettit
My friend and I were frustrated by this problem, and we saw a lot of other people were too, so we released a free tool called Validifier. Hope this helps someone! Check it out at http://validifier.com/
Sep 27th, 2008
Len Kutchma
Thanks for the heads up Nick!
Sep 27th, 2008
Reply to “Embedding XHTML-Vaild Flash”
Please note: Comment moderation is in effect. It may take some time for your comment to appear. There is no need to resubmit it.
Off-topic comments, personal attacks, obvious spam and support requests will likely not make it out of moderation. This site does not necessarily endorse or agree with comments left here.