Why are flash sites telling me my version of flash is too old?
There is an old flash version detection algorithm out there like this:
ver version = getVersion();
if (version.substr(4, 1) < "8"){
// tell user to upgrade flash
}
This code isn't working for Flash 10. The version strings from flash look like this:
Version Strings
Flash 9 : WIN 9,0,115,0
Flash 10: WIN 10,0,12,36
and when you chop off the first four characters "WIN " and then take the next character as directed in version.substr(4,1) you get this:
Version Strings after version.substr(4,1);
Flash 9 : 9
Flash 10: 1
here is a function you can wrap the getVersion with and get the correct flash player major version number.
function getVersionFromString(versionString) {
var versionStringArray = versionString.split(" ");
var versionNumberArray = versionStringArray[1].split(",");
var versionMajorNumber = versionNumberArray[0];
return versionMajorNumber;
}
var version = getVersionFromString(getVersion());
if (version < 8)
// tell user to upgrade
}
That should fix your problems, let me know if you have any other issues.
|