Embedding Flash that is XHTML-Compliant

Friday, May 22nd, 2009

Embed Flash that is XHTML compliant

Embed Flash that is XHTML compliant

Ever try to embed flash with Macromedia Dreamweaver’s tools? You usually get something like this:

<script type=”text/javascript”>
AC_FL_RunContent( ‘codebase’,'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0′,’width’,
‘300′,’height’,'180′,’src’,'xml_rotator’,'quality’,'high’,'pluginspage’,'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash’,'movie’,'xml_rotator’ ); //end AC code
</script><noscript><object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0″ width=”300″ height=”180″>
<param name=”movie” value=”flashfile.swf” />
<param name=”quality” value=”high” />
<embed src=”flashfile.swf” quality=”high” pluginspage=”http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash” type=”application/x-shockwave-flash” width=”300″ height=”180″></embed>
</object></noscript>

Well this isn’t going to be XHTML compliant. In order to fix this and still be compliant you have to enter something like this:

<script type=”text/javascript”>
AC_FL_RunContent( ‘type’,'application/x-shockwave-flash’,'data’,'xml_rotator.swf’,'height’,'180′,’width’,'300′,’movie’,'xml_rotator’ ); //end AC code
</script><noscript><object type=”application/x-shockwave-flash” data=”flashfile.swf” height=”180″ width=”300″><param name=”movie” value=”flashfile.swf” /></object></noscript>

The reason for this is that the <embed> tag isn’t supported XHTML markup. But not according to Macromedia. Hope this helps.

Additional Content Added 6-21-09:

The reason for the error is that the standard HTML code used to displayand embed flash is not W3C (World Wide Web Consortium) compliant. A work around this is to use Javascript to dynamically write the HTML  code when the page is requested and populated at run-time. This will essentially hide the error causing code from the valuators.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MySpace

5 Comments

  1. Great post! Just wanted to let you know you have a new subscriber- me!

  2. Hello, can you please post some more information on this topic? I would like to read more.

  3. nice! i’m gonna make my own journal

  4. Mornin`

    Hey, great post, very well written. You should post more about this.

  5. It sounds like you’re creating problems yourself by trying to solve this issue instead of looking at why their is a problem in the first place.


Leave a Response

* Name, Email, Comment are Required

Spam Protection by WP-SpamFree