Flex 4.12 actually introduced a way to fix this through CSS (4.12 introduced OS and OS version checks as well, which is awesome):
@media (application-dpi: 160) AND (os-platform:"IOS") AND (min-os-version: 7)
{
Application {
osStatusBarHeight: 20;
}
}
But to answer your question, this function does the job:
public static function get iOSVersion():uint {
var iosVersion:String = Capabilities.os.match( /([0-9]\.?){2,3}/ )[0];
return Number( iosVersion.substr( 0, iosVersion.indexOf( "." ) ) );
}
I pulled that from my personal AS3 utility library. For sure, this will not work to get the Android version number and I am unsure if it will work for Mac or Windows. It will return the major version number only (minor versions are generally irrelevant). If you want to change that, just return iosVersion
in the function instead of the second line.