Getting Flash to Validate
by me21st
Feb
2008
I don’t know about you, but I am a validation junkie. If my website code doesn’t validate I get the shakes, cold-sweats, sometimes get delusional, and get angry for no reason. I really do not understand why embed is even used, well sure it’s a small neat code to throw on a website, but anyone can easily modify the code to w3c standards. If I can do it why can’t the big boys do it too?
Here is how I put flash embeds on my website. We’ll use Youtube for an example.
standard Youtube embed code -
<object width=”425″ height=”355″>
<param name=”movie” value=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″></param>
<param name=”wmode” value=”transparent”></param>
<embed src=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″ mce_src=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″ type=”application/x-shockwave-flash” wmode=”transparent” width=”425″ height=”355″></embed>
</object>
The trick to modify this code is to seperate all the embed attributes and then delete the embed tag from start to finish. Now go to your object tag and add the attribute data=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″ ( anytime you see an “&” replace it with “&”) and type=”application/x-shockwave-flash”. Now you can go into the “param” tags, add a backslash before the “>” delete the closing “</param>”tags. So you get something like this -
<object data=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″ width=”425″ height=”355″ type=”application/x-shockwave-flash” >
<param name=”movie” value=”http://www.youtube.com/v/50nHCo2n4Tw&rel=1″ />
<param name=”wmode” value=”transparent”/></object>
Here it is in action
If you want to get into more difficult codes we’ll use the Whos.Amung.Us map widget, like I have in the footer of my website. The original code looked like this -
<embed src=”http://maps.amung.us/flash/flashsrv.php?k=” mce_src=”http://maps.amung.us/flash/flashsrv.php?k=”get your own id”&type=em.swf” quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” allowScriptAccess=”always” allowNetworking=”all” type=”application/x-shockwave-flash” flashvars=”wausitehash=”get your own id”&map=green&pin=target-green&link=yes” width=”200″ height=”135″ />
Now there isn’t even an “object” or a “param” tag, but that is o.k.. First thing I did was erase the black sheep “embed” tag. You only have to put the “src”,”height”,”width” and “type” in the object tag, but change “src” to “data”. Basically you will take all the attributes of the embed tag and put them in param tags like this <param name=”embed attribute” value=”embed attribute value” />.You will get something like this -
<object data=”http://maps.amung.us/flash/flashsrv.php?k=”get your own id”&type=em.swf”
width=”200″ height=”135″ type=”application/x-shockwave-flash”>
<param name=”src” value=”http://maps.amung.us/flash/flashsrv.php?k=”get your own id”&type=em.swf” />
<param name=”quality” value=”high”/>
<param name=”pluginspage” value=”http://www.adobe.com/go/getflashplayer”/>
<param name=”allowScriptAccess” value=”always”/>
<param name=”allowNetworking” value=”all”/>
<param name=”type” value=”application/x-shockwave-flash”/>
<param name=”flashvars” value=”wausitehash=”get your own id”&map=green&pin=target-green&link=yes”/>
</object>
If you look in the footer of this web page you will see it in action.
You can check for yourself about validity –>

