Monday, May 2, 2011

Getting your application version number in AIR 2.6

 The following code reads the application version from the appname-app.xml file in your project directory. Note that your app version is now stored in the "versionNumber" tag - a slight departure from the older AIR syntax where the version was stored in a "version" tag.

var descriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = descriptor.namespaceDeclarations()[0];
var version:String= descriptor.ns::versionNumber;

No comments:

Post a Comment