Making Flash W3C Valid

A little while ago I posted a blog, in which I pledged to find a solution to the W3C complience rules which flash seemed oblivous to. Subsequently after doing some research I came accorss this article, written by Drew McLellan in which he reffers to his satay method, by following all the steps and regiging some of the code flash supplies you with, it is possible to have a fully valid flash object within a html page, but more than this, the flash object will operate in I.E, firefox  and pretty much every other browser you can think of.

If you dont want to read through the entire article I have supplied the core essential knowledge you would need to take your original code for a flash object and modify it into the final lightweight structure you will want to impliment into your website.

Consider the following, this is standard published webpage that flash MX 2004 professional would supply you with;

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="odinHeader" align="middle" height="31" width="751"></object>
<param name="allowScriptAccess" value="sameDomain"></param>
<param name="movie" value="flash.swf"></param>
<param name="loop" value="false"></param>
<param name="menu" value="false"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="transparent"></param>
<param name="bgcolor" value="#ffffff">
</param>
<embed src="flash.swf" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" name="flash" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="31" width="751">
</embed>

As you can see this is a bulky segment of code which requires calling the flash object as both an embedded element as well as an object. Now to simplify all this, basically all we need to do is switch a few of the standard parameters, to enable our object to embed just like this;

<object type="application/x-shockwave-flash" data="flash.swf" width="751" height="31" id="odinHeader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flash.swf" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
</object>

Notice how the first line has chnaged somewhat dramatically, we have stripped out pretty much all aspects that were not working correctly, then substituded some of these tags with new recognised W3C valid componants. The result is a well crafted fully W3C certified flash object on your page. job done!

  • Digg
  • StumbleUpon
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • email
  • Facebook
  • RSS

Talk to me