Hi guys, I am pulling out my hair :(, my code can retrieve the xml file
without any problem. But I was not able to retrieve each node in the follow
case.
Would you please help me to take a look my code? am I mising somehing?
Cheers
===== XML FILE====
<?xml version="1.0" encoding="UTF-8"?>
<root>
<asset type="IMAGE" url="www.google.com" filename="googlefilename"
size="1000"/>
<asset type="IMAGE" url="www.yahoo.com" filename="yahoofilename"
size="1200"/>
<asset type="IMAGE" url="www.bing.com" filename="bingfilename" size="1100"/>
</root>
===== AS3 ========
import flash.events.Event;
var loader:URLLoader = new URLLoader();var request:URLRequest = new
URLRequest("test.xml");var xmlData:XML;var childLength:uint;
loader.addEventListener(Event.COMPLETE, completeHandler);loader.load(request);
function completeHandler(e:Event):void{
xmlData = XML(e.target.data);
childLength = xmlData.children().length();
//trace(xmlData.children()); // <<== I can retrieve the data here
for (var i:uint = 0; i < childLength; i++)
{
trace(xmlData.children()[i]); // <<=== but I can;t get each
node here...
}
}
======= code online =====
http://www.privatepaste.com/89e38a7292
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders