PDA

View Full Version : xml flash as2 problem



doc
01-16-2010, 09:54 AM
Alright, so im trying to learn xml for a school project. This is the code in the flash document

xml=new XML();
xml.load("test.xml")
xml.onLoad=function(loaded){
if(loaded){
trace(xml.firstChild.firstChild);
}
}
This looks good, right?
now this is what's in the xml document.

<a>
<ab>hi</ab>
<bc>hello</bc>
<dc>hiya</dc>
</a>
nothing compicated. To me, this looks like the trace should return <ab>. However, the return is completely blank. No "undefined" or "null" or anything like that. Just blank. Can anyone tell me why this is happening?

edit: oh, and the actual xml is loading nicely. if i put trace(xml) the entire xml doc will show up.