Thanks to lots of help from people on the forum, I’ve managed to target an XML file from a _mc on my main timeline.
On my main timeline I have the following:
var My_XML:XML = new XML();
var rootXML1;
My_XML.ignoreWhite = true;
My_XML.onLoad = function(success:Boolean){
rootXML1 = this.childNodes;
trace(this.status);
if (success){
trace(this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue);
_root.question_mc.gotoAndPlay(2);
gotoAndPlay(3);
} else {
trace("fail");
}
}
My_XML.load(_global.fileName);
And in a movie clip I have:
question_txt.text = _root.rootXML1;
It works - but it displays the entire XML file in the question_txt.text box.
How do I narrow this down to display only one piece of information form my XML file?
In the past, I have used ‘childNodes[0]…’ etc but I can’t seem to get this to work in this instance.
Any help would be gratefully received - you have no idea how long I have laboured over this simple problem!
Thanks for the help so far,
David