14
votes

I have downloaded SWFObject, and included it in my website. Now I want to simply get a true or false value based on whether or not Flash is installed in the users browser when they visit my site.

How can I do this?

2
I don't think that's what swfobject is for. - crimson_penguin
I think that's exactly what SWFObject is for... - Mazatec
OK, I guess I'm wrong. I was going from the fact that the main use of it is just to embed Flash in a page, given a minimum version. But I guess it has detection features you can access directly as well. - crimson_penguin
version detection is automatic with SWFObject. swfobject.embedSWF() function has version control and will display alternate content for a flash player installer if you set it up correctly. - The_asMan

2 Answers

27
votes
if (swfobject.hasFlashPlayerVersion("9.0.18")) {
  // has Flash
}
else {
  // no Flash
}

or replace "9.0.18" with the minimum version you require

1
votes

If You use jQuery SWFObject you could use:

if (!$.flash.hasVersion('9')) {
 //has Flash
}
else {
 //no_flash
}