Find version of your iPhone app in AS3 on iOS and Android

Is there an as3 API in the air (I'm using 3.2) to access my version of the application? The one I give in the App Store or Android Market?

+7
source share
3 answers

Yes, you can pull it directly from the xml descriptor of the application. Something like this should work:

var descriptor:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = descriptor.namespace(); var version:String = descriptor.ns::version[0]; 
+7
source

It looks like it is different from Air 4.0. It worked for me:

 var descriptor:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = descriptor.namespace(); var version:String = descriptor.ns::versionNumber; 
+3
source
 var _descriptor:XML = nativeApplication.applicationDescriptor; var ns:Namespace = _descriptor.namespace(); var version:String = _descriptor.ns::versionNumber; 

This is what works for me. The "descriptor" var is used in AIR 3.2 for the UIComponentDescriptor, so I could not use this variable name. Also, static access to nativeApplication (NativeApplication.nativeApplication) gave me a reference to a null pointer, so I just grabbed it directly.

Finally, versionNumber is what stores the version in AIR 3.2.

+2
source

All Articles