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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash detection... I'm close, but need a little help

Status
Not open for further replies.

CL328

MIS
May 19, 2002
25
0
0
US
This script detects if flash 6 is installed.
If yes, then display movie,
If no, then display image.

HOWEVER, in netscape, I can tell which version of flash is installed. When in netscape and wrong version of flash installed, a blank area appears where the flash movie "would" appear.

Any ideas on how to fix the script to check for version in netscape
THANKS


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf(&quot;msie&quot;) != -1);
var ns = (navigator.appName.indexOf(&quot;Netscape&quot;) != -1);
var win = ((agt.indexOf(&quot;win&quot;)!=-1) || (agt.indexOf(&quot;32bit&quot;)!=-1));
var mac = (agt.indexOf(&quot;mac&quot;)!=-1);
var flash6 = false;

if (ie) {
result = false;
document.write('<SCRIPT LANGUAGE=&quot;VBScript&quot;>\n on error resume next \n result = IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash.6&quot;))<\/SCRIPT>');
if (result)
{
flash6 = true; }
}
if (ns) {
if (navigator.plugins[&quot;Shockwave Flash&quot;])
{ flash6 = true }
}
if (flash6){
document.write(' <img src=&quot;&quot; width=&quot;1&quot; height=&quot;1&quot;>');
document.write('<object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,29,0&quot; width=&quot;450&quot; height=&quot;237&quot;>');
document.write(' <param name=&quot;movie&quot; value=&quot;principals.swf&quot;>');
document.write(' <param name=&quot;quality&quot; value=&quot;high&quot;>');
document.write(' <embed src=&quot;principals.swf&quot; quality=&quot;high&quot; pluginspage=&quot;http:\/\/ type=&quot;application\/x-shockwave-flash&quot; width=&quot;450&quot; height=&quot;237&quot;><\/embed>');
document.write('<\/object>');
}
else {
document.write('<img src=&quot;6principles.gif&quot; width=&quot;450&quot; height=&quot;237&quot;>');
}
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top