Flash incorporation for non-flash user

liunx

Guest
Originally posted here: <!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=33299">http://forums.webdeveloper.com/showthre ... adid=33299</a><!-- m -->, but that forum is rarely visited lately.<br />
<br />
Please, advise.<!--content-->I use Javascript to detect whether the user has the flash plugin. If they do then I write the <object....etc to display the flash, and if not they can get a flat image. <br />
<br />
Here's the code which you want to modify:<br />
<br />
<SCRIPT LANGUAGE="Javascript"><br />
<!--<br />
<br />
var flashinstalled = 0;<br />
var flashversion = 0;<br />
MSDetect = "false";<br />
if (navigator.plugins && navigator.plugins.length)<br />
{<br />
x = navigator.plugins["Shockwave Flash"];<br />
if (x)<br />
{<br />
flashinstalled = 2;<br />
if (x.description)<br />
{<br />
y = x.description;<br />
flashversion = y.charAt(y.indexOf('.')-1);<br />
}<br />
}<br />
else<br />
flashinstalled = 1;<br />
if (navigator.plugins["Shockwave Flash 2.0"])<br />
{<br />
flashinstalled = 2;<br />
flashversion = 2;<br />
}<br />
}<br />
else if (navigator.mimeTypes && navigator.mimeTypes.length)<br />
{<br />
x = navigator.mimeTypes['application/x-shockwave-flash'];<br />
if (x && x.enabledPlugin)<br />
flashinstalled = 2;<br />
else<br />
flashinstalled = 1;<br />
}<br />
else<br />
MSDetect = "true";<br />
<br />
// --><br />
</SCRIPT><br />
<br />
<SCRIPT LANGUAGE="VBScript"><br />
<br />
on error resume next<br />
<br />
If MSDetect = "true" Then<br />
For i = 2 to 6<br />
If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then<br />
<br />
Else<br />
flashinstalled = 2<br />
flashversion = i<br />
End If<br />
Next<br />
End If<br />
<br />
If flashinstalled = 0 Then<br />
flashinstalled = 1<br />
End If<br />
<br />
</SCRIPT><br />
<br />
<script language="Javascript"><br />
<br />
function isFlash() {<br />
<br />
if (flashinstalled == 2) {<br />
return true;<br />
} else {<br />
return false;<br />
} <br />
}<br />
<br />
<br />
if (isFlash()) {<br />
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'); // and all the rest....<br />
<br />
<br />
}<br />
</script><br />
<br />
<br />
<br />
Hope this helps<!--content-->
 
Back
Top