admin管理员组

文章数量:1187530

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?

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?

Share Improve this question edited Apr 19, 2011 at 13:34 andynormancx 13.7k6 gold badges38 silver badges52 bronze badges asked Apr 19, 2011 at 13:24 MazatecMazatec 11.6k23 gold badges74 silver badges108 bronze badges 4
  • 1 I don't think that's what swfobject is for. – crimson_penguin Commented Apr 19, 2011 at 13:29
  • 2 I think that's exactly what SWFObject is for... – Mazatec Commented Apr 19, 2011 at 13:33
  • 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 Commented Apr 19, 2011 at 13:42
  • 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 Commented Apr 19, 2011 at 19:55
Add a comment  | 

2 Answers 2

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

or replace "9.0.18" with the minimum version you require

If You use jQuery SWFObject you could use:

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

本文标签: javascripthow to detect flash using SWFObjectStack Overflow