views:

222

answers:

2

It appears I'm not able to detect the installed version of flash on Vista/IE7.

The following code fails:

var x = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');

The error I'm getting is:

automation server cannot create object

Looking at the Adobe Flash Detection Kit (from adobe), it looks like that's failing as well. I only have 1 vista machine to test with, so I'm curious:

  • Are there ways around the problem
  • Does this problem occur for everyone?

I have successfully tested this on IE6 and IE7 on Windows XP.

A: 

There are great examples on how to retrieve the version of currently installed Flash version. All of the similar examples are using actionscript (v2+), they just assemble information about the flash version and show it to the user.

fixed
Unfortunately I'm looking for _the_ javascript method, even adobe's own detection system fails.
Evert
I am on Win XP and IE8 - I have tried out two different flash detection libraries in js. Both of them worked for me - maybe it will also help you:http://www.featureblend.com/javascript-flash-detection-library.htmlhttp://web.mit.edu/is/web/reference/guidelines/flash/example.html
fixed
Haven't seen a satisfying answer, so I'm going to accept this one.
Evert
A: 

Looks like swfobject - http://code.google.com/p/swfobject/ - is an option that may actually work.

"It is the successor of SWFObject 1.5, UFO, and the Adobe Flash Player Detection Kit." - http://www.adobe.com/devnet/flashplayer/articles/swfobject.html

Code would look something like this (haven't tested on a machine that doesn't have Flash installed):

<script type="text/javascript" src="/Scripts/swfobject/swfobject.js"></script>
<script type="text/javascript">
$(window).load(function() {
    try {
        var flashPlayer = swfobject.getFlashPlayerVersion();
        var flashVersion = flashPlayer.major + "." + flashPlayer.minor + "." + flashPlayer.release;
    } catch (ex) {
    }
});
</script>
James Skemp
thanks for trying, but this was quite an old one; and I don't think this is very relevant anymore. I suspect it was a bug specific to my setup there.
Evert