What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Javascript (detect Flash)

Javascript (detect Flash)
Author: Message:
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
O.P. Javascript (detect Flash)
Ok,
I need some javascript for a site which checks if the user has flash installed and if it is installed what version it is!
Can anyone do it please?
Cheers,
Nathan

This post was edited on 10-20-2006 at 03:15 PM by WDZ.
Touch Innovation - touch friendly programs/applications for the windows mobile!


10-16-2006 09:00 PM
Profile E-Mail PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
Joined: Jul 2003
RE: Javascript
code:
<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>

Source:     http://www.quirksmode.org/js/flash.html
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
10-16-2006 09:04 PM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
O.P. RE: Javascript
dempsey, if you had said you had coded that yourself my uncle would of paid you. :P
and thanks =p

This post was edited on 10-16-2006 at 09:08 PM by Nathan.
Touch Innovation - touch friendly programs/applications for the windows mobile!


10-16-2006 09:06 PM
Profile E-Mail PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Javascript
Erm, doesn't Flash have an option to check for certain versions when you publish the HTML file as well? Thats what I usually do...
<Eljay> "Problems encountered: shit blew up" :zippy:
10-19-2006 06:29 PM
Profile PM Find Quote Report
vaccination
Veteran Member
*****

Avatar

Posts: 2513
Reputation: 43
33 / Male / –
Joined: Apr 2005
RE: Javascript
quote:
Originally posted by SpunkyLoveMuff
Erm, doesn't Flash have an option to check for certain versions when you publish the HTML file as well? Thats what I usually do...

Yeah it does, but maybe Nathan is doing something different. Somehow :P
[Image: jumbled.png]
10-19-2006 10:14 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On