• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

Auto-detect Flash scripts/method needed

I've got a couple of sites done in flash. But i've yet to have any solution for detecting whether anot the viewers have any flash plugin. People have been complaining that flash doesn't show up on certain computers, especially on Mac. I've already run thru the macromedia flash support page, but i'm still not quite clear on which method to use. There, they mention about using javascripts but there is't any scripts provided. Please help. btw, i'm on Windows 98, flash 5.
  • 2
2 Solutions
if u have dreamweaver, just use the standard plugin check for flash.

or from the MM site it does give u the script to do the detection


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 4 or greater is available} else { //Flash 4 is not available}

here's another one for u ...

have a look and see if that helps


Note: Netscape Navigator (Macintosh and Windows) and Internet Explorer (Macintosh) do not have built-in player detection.

just some extra info ...

<script language="JavaScript" type="text/JavaScript">
function checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.flash!=null) ok=window.flash;
    else if (plgIn.indexOf("Director")!=-1 && window.dir!=null) ok=window.dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;

<!--Change gotflash.htm for flash found and noflash.htm for no flash found//-->

<body onLoad="checkPlugin('Shockwave Flash','gotflash.htm','noflash.htm',false);return document.returnValue">

<script name="Used by MM_checkPlugin" language="javascript">
with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+
'<scr'+'ipt language="VBScript">\nOn error resume next\n'+
'dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+
'flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');

This will go to the url gotflash.htm if flash is there and noflash.htm if it is.

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now