开发者

Finding major version of AIR runtime

开发者 https://www.devze.com 2023-02-28 18:49 出处:网络
NativeApplication.nativeApplication.runtimeVersion returns the runtime version, but what is the best way to create a function which will return the major version?

NativeApplication.nativeApplication.runtimeVersion returns the runtime version, but what is the best way to create a function which will return the major version?

For version 2.6.0.19120, the function should return 2 only. This function should work even wh开发者_如何学编程en AIR reaches version 10.


A future safe (for both AIR and your code, which might need the minor number):

var versionNumbers:Array = NativeApplication.nativeApplication.runtimeVersion.split(".");
var versionMajor:String = versionNumbers[0] as String;


Clamp to first point:

var version:String = NativeApplication.nativeApplication.runtimeVersion;
version = version.substring(0, version.indexOf("."));
0

精彩评论

暂无评论...
验证码 换一张
取 消