Hi Everyone,
so I have this really cool XML parse script to load my different texts into two different textboxes.
This version:
// PARSE XML TEXT
function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.sunset = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
name_txt.text = _root.inventor;
scroller.text = _root.sunset;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
//END PARSE XML TEXT
works fine… I get the header and the body part (meaning the two textfields are loaded with text)
If I, however do this:
// PARSE XML TEXT
function loadXML(loaded) {
if (loaded) {
_root.who = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.news = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
name_txt.text = _root.who;
scroller.text = _root.news;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
//END PARSE XML TEXT
it aint working no more…
what am I missing here?
Help appreciated, thanks in advance,
m.