MACROMEDIA FLASH ![]() |
DETECTING FLASH 3 IN A BROWSER ![]() |
Basic Flash 3 Detection
Want a copy of the script? Right-click (or click & hold on Mac) and choose "Save link as..." to download:
detect3.html (the script page)
flash3content.html (the Flash page)
upgradeflash.html (the Flash upgrade page)
nonflash.html (the installation/alternate content page)
unabletodetectflash.html (the failed javascript page)
Description:
This script is nearly identical to the Flash 2+ detector, but requires users to have Flash 3 in order to access Flash content. The only differences between this script and th Flash 2 detector are 1) we only send users to the flash3content.html page if their navigator.plugins array reports "Shockwave Flash", not "Shockwave Flash 2.0", and 2) because we will be preventing Flash 2 users from viewing the Flash content, we add a page to ask those users to upgrade.
Here's the code:
<HTML> <HEAD> <TITLE>Flash Detection In Progress</TITLE> <META HTTP-EQUIV="Refresh" CONTENT="10;URL=unabletodetectflash.html"> <SCRIPT LANGUAGE="JavaScript"> <!-- //Flash 3 Plugin Detector, Version 1.0 //Code maintained at: http://www.moock.org/webdesign/flash/ //Copy permission granted for non-commercial uses. Written by Colin Moock. function detectflash(){ //********Set the names of your web pages here:***** flashpage = "flash3content.html" upgradepage = "upgradeflash.html" nonflashpage = "nonflash.html" cantdetectpage = "unabletodetectflash.html" //************************************************** noautoinstall = "" if(navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("3.1") != -1)){ noautoinstall = "true"; } if (navigator.appName == "Microsoft Internet Explorer" && noautoinstall != "true"){ window.location=flashpage; } else if(navigator.plugins){ if(navigator.plugins["Shockwave Flash"]){ window.location=flashpage; } else if(navigator.plugins["Shockwave Flash 2.0"]){ window.location=upgradepage; } else{ window.location=nonflashpage; } } else { window.location=cantdetectpage; } } // --> </SCRIPT> </HEAD> <BODY BGCOLOR="#FFFFFF" ONLOAD="detectflash()"> <CENTER> <P><FONT FACE="ARIAL"><B>Please wait...scanning your browser for <A HREF="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">Macromedia Flash</A></B></FONT></P> <P><FONT FACE="ARIAL" SIZE="-1">You may also proceed manually to:<BR><A HREF="flashcontent.html">Flash Content<BR><A HREF="nonflash.html">Non-Flash Content</FONT></P> </CENTER> </BODY> </HTML>