Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 detect the versionNumber parameter on the accompanying XML description file for the AIR app.

<!-- 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 this? For example in the About box of the app, instead of manually editing the version displayed, I want it to rely on this one.

like image 876
Propeller Avatar asked Mar 10 '12 10:03

Propeller


1 Answers

  var appXML:XML =  NativeApplication.nativeApplication.applicationDescriptor;

you can parse version number from this xml , like this

var ns:Namespace = appXML.namespace();
trace(appXML.ns::versionNumber);
like image 88
rejo Avatar answered Sep 21 '22 06:09

rejo