2 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.net/yui/license.txt
8 * Utility for Flash version detection
9 * @namespace YAHOO.util
12 YAHOO.namespace("util");
15 * Flafh detection utility.
22 var uA = YAHOO.env.ua;
23 var sF = "ShockwaveFlash";
25 if (uA.gecko || uA.webkit || uA.opera) {
26 if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {
27 if ((eP = mF.enabledPlugin)) {
29 vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.');
30 version = vS[0] + '.';
31 switch((vS[2].toString()).length)
41 version = parseFloat(version);
48 var ax6 = new ActiveXObject(sF + "." + sF + ".6");
49 ax6.AllowScriptAccess = "always";
61 var ax = new ActiveXObject(sF + "." + sF);
63 vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(',');
64 version = vS[0] + '.';
65 switch((vS[2].toString()).length)
75 version = parseFloat(version);
83 YAHOO.util.SWFDetect = {
84 getFlashVersion : function () {
88 isFlashVersionAtLeast : function (ver) {
89 return version >= ver;
93 YAHOO.register("swfdetect", YAHOO.util.SWFDetect, {version: "2.8.0r4", build: "2449"});