I have a problem while reading from XML file in action script 3.
This is my XML-file:
<config>
<production>
<app_id>123</app_id>
<server_path>http://someLinktoAccess</server_path>
<assets_server>http://someLinktoAccess</assets_server>
<payment_url_callback>http://someLinktoAccess</payment_url_callback>
</production>
<stage>
<app_id>123</app_id>
<server_path>http://someLinktoAccess</server_path>
<assets_server>http://someLinktoAccess</assets_server>
<payment_url_callback>http://someLinktoAccess</payment_url_callback>
</stage>
<dev>
<app_id>123</app_id>
<server_path>http://someLinktoAccess</server_path>
<assets_server>http://someLinktoAccess</assets_server>
<payment_url_callback>http://someLinktoAccess</payment_url_callback>
</dev>
</config>
I want to access to each key-value pair in this file. So I want to get from here 4 string variables: app_id, server_path, assets_server, payment_url_callback. How can I get them??
Now I'm using such a code:
private function loadXmlConfig():void
{
//load the loading config xml
var xmlLoader:URLLoader = new URLLoader();
var load_config_path:String = "http://dl.dropbox.com/u/28744968/android_vs.xml";
xmlLoader.addEventListener(Event.COMPLETE, xmlConfigLoadingSuccessed);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlConfigLoadingFailed);
xmlLoader.load( new URLRequest( load_config_path ) );
}
private function xmlConfigLoadingSuccessed(event:Event):void
{
var load_config:XML = new XML( event.target.data );
trace(load_config.config.dev.app_id.value);
//startup facade
GameFacade.getInstance().startup( StartupCommand, this );
}
The file is loaded with all values, but I can't access any of them.
What mean this:
var library:XML
library.@url
Thank you!
XMLListhelp.adobe.com/en_US/FlashPlatform/reference/actionscript/3/…trace(load_config.config.dev.app_id.value);, trytrace(load_config.dev.app_id.value);.