Question

simple question: I'm looking for a standards compliant way to embed a flash file. I've been using Dreamweaver for this project (not because I like it, but because my co-worker isn't an HTML guru) and it apparantly uses non-standard code to embed flash files. It's probably standard in HTML, but not so much in XHTML which I prefer to use.

What is the standards compliant way to do this? I'd prefer to do it without using that JavaScript library that everyone seems to use, I'm looking for a pure XHTML solution so that my pages degrade gracefully when JavaScript is not enabled.

Thanks, I can post my existing non-compliant code if needed.

Was it helpful?

Solution

Here's some info on the Satay methods.

The standards compliant way is to use the <object /> tag, with the appropriate type set. However, the support across different browsers is pretty sketchy. Your best bet is really to use a javascript library such as swfObject to replace/embed the flash into a given div tag.

For the most part, those that disable javascript are likely to not have flash, or to have that disabled as well. Also, the fallback html within the div to be replaced with the flash can be more easily tested as well.

I don't like it any better than you do to be honest, but it really is the easiest way to make sure it works... below is an example if you chose to go that path.


  <object id="myflash" type="application/x-shockwave-flash" data="myfile.swf">
    <param name="movie" value="myfile.swf" />
  </object>

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top