PlugIn Problem

Discussion in 'Web Development' started by finddinesh, Nov 6, 2006.

  1. finddinesh

    finddinesh New Member

    Joined:
    Nov 6, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    48
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    The method you are using to check for the flash plugin is not correct, find the correct method below. Also, try to put the flash checking code in JavaScript and not VBScript 'coz JavaScript is more widely supported.

    Code:
    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";
    Code:
    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
    After the detect, the variable flashinstalled can have three values:

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice