views:

22

answers:

1

So I have a basic application descriptor file for my AIR app. It looks something like this, shortened for sanity:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.0"&gt;
  <version>1.0.10</version>
</application>

Now I want in the application to display the version, but I don't want to have to maintain the version in multiple places, so how can I read that version number from within the application?

+2  A: 

Check the following code:

            var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor;
            var ns:Namespace = appXml.namespace(); 
            trace(appXml.ns::version); 
Cornel Creanga
Well done good sir!
invertedSpear