Skip to content Skip to sidebar Skip to footer

Providing Alternative Images If Adobe Flash Isn't Available

Are there any ways providing an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated. I’ve found recommendations, like the following from W3C

Solution 1:

Actually having flash installed but javascript turned off is a valid scenario. This should work across most browsers:

<objectclassid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"width="800"height="600"id="flashContent"><paramname="movie"value="flash.swf" /><!--[if !IE]>--><objecttype="application/x-shockwave-flash"data="flash.swf"width="800"height="600"><!--<![endif]--><imgsrc="(...)"alt="Put your alternate content here" /><!--[if !IE]>--></object><!--<![endif]--></object>

Solution 2:

I use the following code for graceful degradation. It works well.

<!--[if !IE]> --><objecttype="application/x-shockwave-flash"data="flash.swf"width="500"height="100"><!-- <![endif]--><!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" 
    width="500" height="100">
  <param name="movie" value="flash.swf" />
<!--><!--dgx--><paramname="loop"value="false"><paramname="menu"value="false"><paramname="quality"value="high"><imgsrc="flash_replacement.png"width="500"height="100"alt="No Flash"></object><!-- <![endif]-->

Solution 3:

I don't know why you want to avoid javascript, it is the best solution when dealing with Flash.

using the SWFObjects Library (the best known so far for the matter) you can do this:

<!DOCTYPE htmlPUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><title> My Home Page </title><metaname="viewport"content="width=780"><scripttype="text/javascript"src="swfobject.js"></script></head><body><divid="splashintro"><ahref="more.html"><imgsrc="splash_noflash.png" /></a></div><scripttype="text/javascript">var so = newSWFObject("csplash.swf", "my_intro", "300", "240", "8", "#338899"); 
   so.write("splashintro"); 
 </script></body></html>

what the script does is replace the splashintro div with the flash file, if the browser does not support Flash, then does nothing and the splash_noflash.png will be shown.

P.S. With this technique you are ready for the iPhone, instead of showing the blue cube, it will show the image :)

Solution 4:

I find using inline styling to do the trick.

For example:

<divstyle="background-image: url('...');"><object>
     /* Embedded Flash */
    </object></div>

Solution 5:

We can provide an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.

<objectid="flashcontent classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550px"height="400px"><paramname="movie"value="mymovie.swf" /><!--[if !IE]>--><objecttype="application/x-shockwave-flash"data="mymovie.swf"width="550px"height="400px"><!--<![endif]--><p>
Fallback or 'alternate' content goes here.
This content will only be visible if the SWF fails to load.
</p><!--[if !IE]>--></object><!--<![endif]--></object>

And also add this...

<scripttype="text/javascript">
swfobject.registerObject("flashcontent", "9", "/path/to/expressinstall.swf");   
</script>

Post a Comment for "Providing Alternative Images If Adobe Flash Isn't Available"