One important issue that fellow web designers have is embedding flash (SWF) objects with valid XHTML code. Unfortunately the Dreamweaver code for implementing flash is not valid by W3C. This post will explain how to make it happen
<---------- Dreamweaver generated code for SWF -------------->
<object classid="clsid=27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="100" height="100">
<param name="movie" value="name_of_flash.swf" />
<param name="quality" value="high" />
<embed src="name_of_flash.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="100"></embed>
</object>
<--------------- Valid code for XHTML (transitional) ------------------>
<object type="application/x-shockwave-flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
data="name_of_flash.swf"
width="100" height="100">
<param name="movie" value="name_of_flash.swf" />
<param name="quality" value="high"/>
</object>
Instructions
- Remove the embed -tag, it isn't needed and it doesn't validate.
- The classid tells Internet Explorer which player to use, fortunately, Flash Player responds to type="application/x-shockwave-flash" as well, so we can remove this ugly line.
- The codebase attribute is optional.
- The only one left: the data-element, it tells Mozilla and Opera where the music is located since they won't get it out of the param-element.
There you have it nice and tidy
Original information found from Joost de Valk's blog
Last edited by John Efstathiou : 03-31-2008 at 12:28 PM.
|