Detect versionNumber from MyProject-App.xml? Adobe air

The desktop application I'm working on is being developed in Adobe AIR + Flex + As3. Now I want to define the versionNumber parameter in the accompanying XML description file for the AIR application.

<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. Values can also be 1-part or 2-part. It is not necessary to have a 3-part value. An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . --> <versionNumber>1.0.0</versionNumber> 

Is there a variable or property that I can use to access it? For example, in the "About" window, instead of manually editing the displayed version, I want him to rely on it.

+4
source share
3 answers
  var appXML:XML = NativeApplication.nativeApplication.applicationDescriptor; 

you can parse the version number from this xml like

 var ns:Namespace = appXML.namespace(); trace(appXML.ns::versionNumber); 
+11
source

You can use the applicationDescriptor property from the NativeApplication class to get the xml application descriptor http://help.adobe.com/en_US/air/reference/html/flash/desktop/NativeApplication.html

+1
source

If you want to use not only numbers - 2.1.1 - and put alpha / beta ... you should use "versionLabel" and not "versionNumber"

 var xml:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = xml.namespace(); var version:String = xml.ns::versionLabel; 
0
source

Source: https://habr.com/ru/post/1400718/


All Articles