geeky · non php code

XHTML strict validated flash code

i put up a slideshow of the silver jewelry club photos i’ve saved. after i added the code given to me directly from slide.com, my site no longer validates with XHTML 1.0 strict rules. So I researched on valid flash embed code and found this nifty javascript trick for embedding flash.

The code given to me from the slide.com:

<embed src="http://widget.slide.com/widgets/slideticker.swf" 
	quality="high" 
	scale="noscale" 
	salign="l" 
	flashvars="site=widget.slide.com&channel=181375" 
	wmode="transparent" 
	bgcolor="#f5f5f5" 
	width="205" 
	height="97"
	name="flashticker" 
	align="middle" 
	type="application/x-shockwave-flash" 
	pluginspage="http://www.macromedia.com/go/getflashplayer"/>

The final code I put up that works & validates:

<div id="slideshow">If you don't see the slideshow, <a href="http://www.flickr.com/photos/68167759@N00/">click here.</a>.</div>
<script type="text/javascript"> 
// <![CDATA[ 
	var fo = new FlashObject("http://widget.slide.com/widgets/slideticker.swf?site=widget.slide.com&amp;channel=181375", "flashticker", "205", "97", "6", "#ffffff"); 
	fo.addVariable("wmode", "transparent"); 
	fo.addVariable("quality", "high"); 
	fo.addVariable("scale", "noscale"); 
	fo.addVariable("salign", "l"); 
	fo.addVariable("align", "middle"); 
	fo.write("slideshow"); 
// ]]>
</script>

given that I’ve properly uploaded flashobject.js and included in the header of my HTML with:

<script type="text/javascript" src="/js/flashobject.js"></script>

One thought on “XHTML strict validated flash code

  1. My buddy Jim and I over at Done21.com were having this exact problem, so we built a tool for it. It ended up working really well, so we decided to release it for free as our way of giving back to the web.

    The tool we made is called Validifier, available at http://validifier.com/

    You just paste your Flash embed code and translates it into valid XHTML automatically. I run a video blog and I’ve found it to be really handy. I hope this helps someone! πŸ˜€

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s