my boss just asked me to create a page that will display a flash animiation but should display a static image if the user's browser doesn't have flash installed.
I'm pretty sure it's not so simple as just putting both 'elements' on the page...but I'm not sure about the flash detection. I wrote a script a few years back that reported several browser settings (flash being one of them), but that was a pretty JS heavy endeavor....I'd like to avoid that if possible.
display flash if you have it, image if not
Moderator: General Moderators
I don't know about the latest Flash release but MX had an export/publish option that created some JS to do just that. Here's what it looks like.
Code: Select all
<SCRIPT LANGUAGE=JavaScript1.1 type="text/javascript">
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
document.write(' ID="songmovie" WIDTH="150" HEIGHT="30" ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="songmovie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
document.write(' <EMBED src="songmovie.swf" quality=high bgcolor=#FFFFFF ');
document.write(' swLiveConnect=FALSE WIDTH="150" HEIGHT="30" NAME="songmovie" ALIGN=""');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else{
document.write('<IMG SRC="songmovie.gif" WIDTH="150" HEIGHT="30" usemap="#songmovie" BORDER=0>');
}
//-->
</SCRIPT>- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Code: Select all
<object>
<param></param>
<param></param>
<param></param>
<element>Alternative content here.</element>
</object>Code: Select all
<object>
<param></param>
<param></param>
<param></param>
<img alt="" src="" title="" />
</object>Best of luck!