• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Get data from application descriptor file at runtime

Community Beginner ,
Jul 22, 2014 Jul 22, 2014

Copy link to clipboard

Copied

Hi there,

For some reason I have to read some data out of the application descriptor file at runtime. Precisely, I am interested in the UIDeviceFamily tag which indicates whether the app is iPhone / iPod only or if runs on iPad too :

<key>UIDeviceFamily</key>

<array>

<string>1</string>

</array>

I can access the <InfoAdditions> node which is the parent, but I can't go deeper :

var appDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;

var ns:Namespace = appDescriptor.namespace();

var iPhone:XML = new XML( appDescriptor.ns::iPhone );


var data:XML = new XML( iPhone.child(0) );


I think that's because the XML is not formatted correctly for the AS3 parser. I tried to use RegEx but I am not that good with those things 😞


var reg:RegExp = /.*?<key>UIDeviceFamily<\/key><array>(.*?)<\/array><key>UIPrerenderedIcon<\/key>/gi;

var s2:String = reg.exec( s1 )[1];

Any advice on this would be welcome !


TOPICS
Development

Views

121

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines