[RESOLVED] Troubles parsing XML in AS3
Greetings,
Perhaps someone can help with this... Having trouble breaking down the XML. The following function is called on a succesful file load:
function XMLLoaded(e:Event):void
{
trace("Loaded XML.");
var theXML = new XML(e.target.data);
var theTracks:XMLList = theXML.playlist.trackList.track;
trace(theXML.playlist);
trace(theTracks[0]);
...
The debugger shows me that theXML variable has indeed been loaded with the file contents. But the first trace yields no output and the second one is undefined.
Here's the XML file:
<playlist>
<trackList>
<track>
<title>Test 1.1</title>
<location>file:///music/br_openingtitles.mp3</location>
</track>
<track>
<title>Test 1.2</title>
<location>file:///music/clarinetquintet.mp3</location>
</track>
<track>
<title>Test 1.3</title>
<location>file:///music/correlation.mp3</location>
</track>
<track>
<title>Test 1.4</title>
<location>file:///music/hostage.mp3</location>
</track>
</trackList>
</playlist>
Any help greatly appreciated!