XML in Actionscript 3?

sion89

New Member
I've been trying to get the tracks out of my XML file that looks like this\[code\]<?xml version="1.0"?><tracklist> <track ID="4" title="Track01" artist="Artist01" url="" length="" coverURL=""/> <track ID="1" title="Track02" artist="Artist02" url="" length="" coverURL=""/> <track ID="8" title="Track03" artist="Artist03" url="" length="" coverURL=""/></tracklist>\[/code\]into an array in ActionScript 3.I couldn't figure it out. I tried it like this:\[code\]var myLoader:URLLoader = new URLLoader();myLoader.load(new URLRequest("http://localhost:8888/Fabse/src/getCommonPlaylist.php"));myLoader.addEventListener(Event.COMPLETE, processXML); function processXML(e:Event):void { var xml:XML= new XML(e.target.data); xml.ignoreWhitespace=true; var list:XMLList = XMLList(xml.track); }\[/code\]Then I tried a billion ways to get the Data out of the list or the "xml" variable with only blank traces and no success whatsoever. The only thing that works is trace(xml.track) which traces all track objects.What am I doing wrong?Thank you in advance,Matteo
 
Back
Top