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!

Detetecting Flash VERSION in IE and NN... help

Status
Not open for further replies.

CL328

MIS
May 19, 2002
25
0
0
US
THis is my goal:
Have web page check for Flash 6.
If browswer has Flash 6 Then show flash movie
ELSE show image.

I don't want anything else to happen.

This is what I have so far, which works except of the checking of Flash 6.

Can someone point me in the right direction/show me how
to replace the (true) with the code to check for Flash 6?

THANKS IN ADVANCE
I have been looking/searching and can't seem to find the correct answer.


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

if (true) {
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>
 
I'm going to try this... BUT For NN, it is not detecting the version? Any ideas?


<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
if (navigator.appName == &quot;Netscape&quot;) {
if (navigator.plugins[&quot;Shockwave Flash&quot;]){
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>
<SCRIPT LANGUAGE=VBScript>
on error resume next
var GotFlash
GotFlash = IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash.6&quot;))
If GotFlash = True Then
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;>');
End If
</SCRIPT>
 
This is closer, but not working:


<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=VBScript>\n on error resume next \n result = IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash.6))<\/SCRIPT>\n');
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