jOEL
September 20, 2002, 5:19pm
1
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
system
September 20, 2002, 5:56pm
2
system
September 22, 2002, 7:15am
3
Go to macromedia’s site and search for their “Flash detection kit”, it’s all in there.
system
September 25, 2002, 3:52am
4
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
system
September 25, 2002, 4:28am
5
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.
system
October 21, 2002, 8:15pm
6
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*)))
continue;
var MM_PluginVersion = words*;
}
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\>
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))
');
document.write('</SCR' + 'IPT\>
');
}
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]