WordPress Expert » embed http://johnlamansky.com/wordpress Wed, 01 Jun 2011 18:58:49 +0000 en hourly 1 http://wordpress.org/?v=3.3 How to Embed XHTML-Compliant Flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/?utm_source=rss&utm_medium=rss&utm_campaign=embed-xhtml-compliant-flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/#comments Mon, 18 Feb 2008 17:15:52 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/embed-xhtml-compliant-flash/ According to Macromedia, the typical method of embedding Flash on a website is using the following HTML, replacing “myFlashMovie.swf” with the filename:

<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>

Not only is this messy-looking, it’s invalid XHTML, since the <embed> element isn’t part of the XHTML specification.

Often this wouldn’t be a problem, but since WordPress uses the stricter XHTML standard instead of the loosey-goosey HTML specification, using such code in your posts, pages, or template will likely cause your blog to not validate.

Thankfully, the same Flash video can be included in the following manner:

<object type="application/x-shockwave-flash" data="myFlashMovie.swf" height="250" width="800"><param name="movie" value="myFlashMovie.swf" /></object>

Not only is this much cleaner and shorter, it also avoids the <embed> element, ensuring XHTML compliance.

]]>
http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/feed/ 3