Skip to page content or Skip to Accesskey List.

Work

Main Page Content

Detecting Flash4 Compatibility

Rated 3.91 (Ratings: 1)

Want more?

  • More articles in Code
 

Ryan Mayberry

Member info

User since: 04 Jun 1999

Articles written: 7

Now that Flash4 has been shipped and everyone and their dog is running out to get a copy, the web is going to be filled with more 'live' content than ever before (specially since FLASH4 ROCKS!) However, there are a lot of unknowing surfers out there who may be coming to your site without the latest plug-in from Macromedia. No problem, you can test their version with the following JavaScript. Place the following code in the header of your HTML page which houses your shockwave flash file. Users with only the FLASH3 compatible plug-in will be redirected to "olderplug.htm".

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?

navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) < 4)

{

window.location="olderplug.htm"

}

Add an ELSE statment to the end of the code and you can even redirect compatible users to a new page. Like this

else {  window.location="flash4Baby.htm"       }

Happy Flashing.

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.org Evolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.