I followed the tutorial “Using XML in Flash CS3/AS3”, to access external xml data.
Everything works just as expected.
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
trace(xmlData.Books); //--> works fine
}
But if I replace the xml file from the tutorial with a new one I’m not able to trace any elements in the self-written xml file:
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
trace(xmlData.Table); // --> doesn't work
}
It doesn’t give me an error message, just a blank output window
The interesting thing is that tracing the whole xml-objekt is possible:
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
trace(xmlData); //--> works also with the replaced xml file
}
Thats the xml file:
<Table>
<Player>
<number>1</number>
<name>Test1</name>
<chips>1500</chips>
</Player>
<Player>
<number>2</number>
<name>Test2</name>
<chips>1500</chips>
</Player>
<Player>
<number>3</number>
<name>Test3</name>
<chips>1500</chips>
</Player>
<Player>
<number>4</number>
<name>Test4</name>
<chips>1500</chips>
</Player>
</Table>
Hopefully anyone finds the problem.