Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. check if flash plugin intalled on browser

check if flash plugin intalled on browser

Scheduled Pinned Locked Moved ASP.NET
helpcomadobetoolscareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gottimukkala
    wrote on last edited by
    #1

    Hi I have a problem with checking if Flash installed on the user's browser in Internet Explorer, Firefox and Chrome(mainly). When the loads the page, it first checks for the flash using client script and I have to pass that(if it's installed or not) to the page. I have the client -sciprt on User Control and my problem here is to pass the result to the code-behind code of the usercotnrol. Here is my client-script code on user control: <!-- 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"; //alert(flashinstalled + " : " +FlashVersion + " : " + navigator.plugins.length); // --> on error resume next If MSDetect = "true" Then For i = 2 to 10 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 Can any one give me idea please! I am stuck here! Thanks in advance.

    -- http://ashakthi.blogspot.com http://kids-articles.blogspot.com

    M T 2 Replies Last reply
    0
    • G gottimukkala

      Hi I have a problem with checking if Flash installed on the user's browser in Internet Explorer, Firefox and Chrome(mainly). When the loads the page, it first checks for the flash using client script and I have to pass that(if it's installed or not) to the page. I have the client -sciprt on User Control and my problem here is to pass the result to the code-behind code of the usercotnrol. Here is my client-script code on user control: <!-- 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"; //alert(flashinstalled + " : " +FlashVersion + " : " + navigator.plugins.length); // --> on error resume next If MSDetect = "true" Then For i = 2 to 10 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 Can any one give me idea please! I am stuck here! Thanks in advance.

      -- http://ashakthi.blogspot.com http://kids-articles.blogspot.com

      M Offline
      M Offline
      Martin Jarvis
      wrote on last edited by
      #2

      Hi, Rather than roll-your-own algorithm, you could use an established JS libary such as swfobject[^] although this is aimed at selectively displaying flash if installed it does have a swfobject.getFlashPlayerVersion() method that will return the installed flash version. Regards, Martin

      1 Reply Last reply
      0
      • G gottimukkala

        Hi I have a problem with checking if Flash installed on the user's browser in Internet Explorer, Firefox and Chrome(mainly). When the loads the page, it first checks for the flash using client script and I have to pass that(if it's installed or not) to the page. I have the client -sciprt on User Control and my problem here is to pass the result to the code-behind code of the usercotnrol. Here is my client-script code on user control: <!-- 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"; //alert(flashinstalled + " : " +FlashVersion + " : " + navigator.plugins.length); // --> on error resume next If MSDetect = "true" Then For i = 2 to 10 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 Can any one give me idea please! I am stuck here! Thanks in advance.

        -- http://ashakthi.blogspot.com http://kids-articles.blogspot.com

        T Offline
        T Offline
        T M Gray
        wrote on last edited by
        #3

        Use an ASP:Hidden control and in your javascript set its value using something like

        var hiddenField = document.getElementById('<%=hidHasFlash.ClientID %>');
        hiddenField.value = flashinstalled

        And please don't use the words true and false as strings in conditionals. It hurts my eyes.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups