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!

  1. Thanks, dude! I’ve been looking for something nice ‘n’ simple like this for a while but never quite got around to it…


  2. You’re most welcome Dennis.


  3. steve fox

    It doesn’t work in FireFox


  4. Thanks for the input Steve. I haven’t actually tested it using Firefox.


  5. 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/


  6. Thanks for the heads up Nick!


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.

 

Private

Back On The Air!

Live weekly show featuring the movers and shakers of WordPress.

  • WordPress

Just Say No!

To themes using obfuscated code.

  • Say No to Obfuscated Code!

Powered By ...

Is there anything else? Anil...?

  • Powered by WordPress!