Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking whether a user can display flash 2

Status
Not open for further replies.

netcomander

Programmer
Jul 20, 2001
68
DE
hi all,

is there anybody who can tell me how to
check, whether a user's browser is able
to display flash or not?

Thanks in advance

greetings markus
 
In dreamweaver there's a function that checks for flash plugin. If found go to url1(yes.htm), if not go to url2(no.htm).

Here is the generated code.

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function MM_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(&quot;Flash&quot;)!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf(&quot;Director&quot;)!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onLoad=&quot;MM_checkPlugin('Shockwave Flash','yes.htm','no.htm',false);return document.MM_returnValue&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
  <tr>
    <td><object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0&quot;[/URL] width=&quot;600&quot; height=&quot;450&quot;>
        <param name=movie value=&quot;intro.swf&quot;>
        <param name=quality value=high>
        <embed src=&quot;intro.swf&quot; quality=high pluginspage=&quot;[URL unfurl="true"]http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot;[/URL] type=&quot;application/x-shockwave-flash&quot; width=&quot;600&quot; height=&quot;450&quot;>
        </embed> 
      </object></td>
  </tr>
</table>
</body>
<script name=&quot;Used by MM_checkPlugin&quot; language=&quot;javascript&quot;>
<!--
with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+
'<scr'+'ipt language=&quot;VBScript&quot;>\nOn error resume next\n'+
'MM_dir = IsObject(CreateObject(&quot;SWCtl.SWCtl.1&quot;))\n'+
'MM_flash = NOT IsNull(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash&quot;))\n</scr'+'ipt>');
//-->
</script>
</html>

This is just one way of doing it, but for me it's the fastest...

Hope it'll help ;-) Have Fun...

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top