XML Code not working

Hi,

I got some XML Code off your Website…The interesting thing is that, the code does work for some but refuses to work somewhere else…which is strange…


//Data.XML
<?xml version="1.0"?>
<disptext>
     <firstcontent>
        <name>Counsellor</name>
     </firstcontent>
     <secondcontent>
        <name>Prince of Peace</name>
     </secondcontent>
     <thirdcontent>
        <name>Saviour</name>
     </thirdcontent>
     <fourthcontent>
        <name>Your Text</name>
     </fourthcontent>
</disptext>

The code to display this in Flash is here…


function loadXML(loaded) { 
if (loaded) { 
//populating the text fields
_root.ftext = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue; 
_root.sectext = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue; 
_root.thirdtext = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue; 
_root.fourthtext = this.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue; 
firsttext.text = _root.ftext; 
secondtext.text = _root.sectext; 
thirdtext.text = _root.thirdtext; 
fourthtext.text = _root.fourthtext; 
} else { 
trace("file not loaded!");; 
} 
} 
xmlData = new XML(); 
xmlData.ignoreWhite = true; 
xmlData.onLoad = loadXML; 
xmlData.load("data.xml"); 

What i notice is that, it’s loading the data for the first and second texts…but nothing afterward. I also interchanged the text fields (called the first one on the third), but still no luck.

I don’t have the XML code on the very first frame, it’s halfway down, but is that a problem ?..as 2 of my 4 text fields are updating. I don’t understand why this happens. I hope someone can help me.