Flex/Air Reading application settings

Reading the application descriptor file

You can read the application descriptor file of the currently running application, as an XML object, by getting the applicationDescriptor property of the NativeApplication object, as in the following:

var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor;

You can then access the application descriptor data as an XML (E4X) object, as in the following:

var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = appXml.namespace();
var appId = appXml.ns::id[0];
var appVersion = appXml.ns::version[0];
var appName = appXml.ns::filename[0];
air.trace("appId:", appId);
air.trace("version:", appVersion);
air.trace("filename:", appName);

For more information, see The application descriptor file structure.

 

var fileTypes:XML = appXml.ns::fileTypes[0];

                    for each ( var fileType:XML in fileTypes.ns::fileType ) {

                        trace(fileType.ns::name);

                    }

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注