Articles / Valid XHTML Flash

Make your html Flash code validate as xhtml.

If you try and insert your flash movie in Dreamweaver by going through the main menu {Insert>Media>Flash}, the code output will validate as xhtml.

In addition, people who don't have the flash plugin in their browser won't see a thing.

There's a solution to both of these problems.

So, the code that Dreamweaver will leave you with will look like:

Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="580" height="400">
  <param name="movie" value="path_to_your/flash_movie.swf" />
  <param name="quality" value="high" />
  <embed src="path_to_your/flash_movie.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="580" height="400"></embed>
</object>


The way to make this code valid and also display an alternative image in case the user doesn't have the flash plugin, is the following:

Code:
<object type="application/x-shockwave-flash" data="path_to_your/flash_movie.swf" width="580" height="400">
<param name="movie" value="path_to_your/flash_movie.swf" />
<img src="path_to_your/alternative_image.jpg" width="580" height="400" alt="alternative image" />
</object>


Shorter, cleaner and works

 

Recent additions :

June 2007 Web Calendar (2007-06-01)
Premium Services (2007-05-30)
CSS Trick: Links Outline (2007-05-30)
Xerolithic Research Group (2007-05-23)
Marios Spiliopoulos (2007-05-23)

World's best web hosting!!

Shared hosting from 6.95 p/m including 50gb space and 200gb bandwidth!!


TESTIMONIALS

For my site I needed a coder that could do everything I listed, stam did everything in a short period of time with results I'm very happy with. If I need help in the future I defianiatly know where to be first.

Mario / kiba-anime.com

--divider--

Stamatis quick links

Stamatis design portfolio
Stamatis free web templates
Stamatis professional logos