PDA

View Full Version : How do I display an alternate image, if the user doesnt have the Flash plugin?



jOEL
September 20th, 2002, 01:19 PM
Hello,

Can anybody offer a solution (I would imagine JavaScript) that would detect wether or not the user has the flash plugin installed and if not, would display an alternate image format in it's place (like a gif, png etc..)?

We have flash in our site being used for navigational buttons and would like to have static images to fall back on without having to have an alternate page to load.

Any help would be greatly appreciated.

jOEL

flex
September 20th, 2002, 01:56 PM
http://hotwired.lycos.com/webmonkey/01/10/index4a_page6.html?tw=multimedia

eyezberg
September 22nd, 2002, 03:15 AM
Go to macromedia's site and search for their "Flash detection kit", it's all in there.

Lynn
September 24th, 2002, 11:52 PM
http://www.kirupa.com/developer/mx/detection.asp

Okay, so now that we know where to find these scripts, what is the easiest way to test them?

Thanks,
Lynn

lostinbeta
September 25th, 2002, 12:28 AM
Pretty much the only way you can test it is to go onto a computer that doesn't have the version of Flash you are testing. Or I believe you can uninstall your Flash Plugin and check then reinstall it.

huggerFanta
October 21st, 2002, 04:15 PM
Just change the

<PARAM NAME=movie to the movie to display and ment.write('IMG SRC to the image to display!

Even change the noscript section to load an image instead!!!!!!


<SCRIPT LANGUAGE=JavaScript1.1>
<!-- this checks for plugin or not plugin!
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="script" WIDTH="320" HEIGHT="236" ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="TheSWFMovie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ');
document.write(' <EMBED src="TheSWFMovie.swf" quality=high bgcolor=#FFFFFF ');
document.write(' swLiveConnect=FALSE WIDTH="320" HEIGHT="236" NAME="script" 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="NoFlashImages.gif" WIDTH="320" HEIGHT="236" usemap="#script" BORDER=0></a>');
}
//-->
</SCRIPT><NOSCRIPT><a href="javascript:Flash('installeraFlash.php')"><IMG SRC="NoFlashNoJavaImages.gif"" WIDTH="320" HEIGHT="236" usemap="#script" BORDER=0></a></NOSCRIPT>

[EDIT by Lostinbeta to show code]