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

Detect Flash...

Status
Not open for further replies.

Ram0135

Technical User
Apr 14, 2003
77
US
Hello,
Is there a way that CFM can check if a user has flash and a certain dialup speed... I have to pages... one is dialup (dialup.htm) which is for users with a slow connection and/or dont have flash. I also have another page flash.htm which is for users that have flash and have fast connections. I want CFM to check the users connection (has to be greater than 56k) and leave a cookie that says that the user has the credentials to look at either the flash or html page. Before all this takes place I want CFM to check for the cookie...

Please Help
Ramon
 
<SCRIPT LANGUAGE="Javascript">
<!--

var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
x = navigator.plugins["Shockwave Flash"];
if (x)
{
flashinstalled = 2;
if (x.description)
{
y = x.description;
flashversion = y.charAt(y.indexOf('.')-1);
}
}
else
flashinstalled = 1;
if (navigator.plugins["Shockwave Flash 2.0"])
{
flashinstalled = 2;
flashversion = 2;
}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-shockwave-flash'];
if (x && x.enabledPlugin)
flashinstalled = 2;
else
flashinstalled = 1;
}
else
MSDetect = "true";

// -->
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">

on error resume next

If MSDetect = "true" Then
For i = 2 to 6
If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then

Else
flashinstalled = 2
flashversion = i
End If
Next
End If

If flashinstalled = 0 Then
flashinstalled = 1
End If

</SCRIPT>

Explanation
After the detect, the variable flashinstalled can have three values:

2: Flash installed
1: Flash not installed
0: Unknown if Flash is installed

I don't think you can tell what speed the user is connected at. I have just put an option for dial-up and one for highspeed see.
Wes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top