Detecting Flash 4

by Gregor Pirnaver <gregor.pirnaver(at)email.si>

 Date:  Fri, 27 Oct 2000 15:59:24 +0200
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
I use the following JavaScript in BODY of HTML to detect
Flash & it works.

if ((navigator.appName == "Microsoft Internet Explorer"
		&& navigator.appVersion.indexOf("Mac") == -1
		&& navigator.appVersion.indexOf("3.1") == -1) ||
	
	(navigator.plugins && navigator.plugins["Shockwave Flash"])
		|| navigator.plugins["Shockwave Flash 2.0"])
		
		flash = true;


... but how to detect Flash 4 (!) with JavaScript?
I tried the following script but it dosen't work...

var plugin = (navigator.mimeTypes &&
  navigator.mimeTypes["application/x-shockwave-flash"] ?
  navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
  if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4)
  flash = true;


--
Gregor

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA