Dynamically-XML-Loaded Text with Buttons Not Loading

Hi everyone, it’s me again. This question relates to the gallery that I’m working on; basically, I am now trying to add text comments which change according to which button you press to the images. I know how to make this work by applying actionscript to each individual button, but I would like to put all of the actionscript on one layer, meaning that I would have to use the ‘button.onRelease = function ()’ operation instead of the 'on (release) { function" operation.

The code is a variation of Kirupa’s code for the tutorial on loading information from an XML, and the xml is his completely. Here it is so far:


xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“inventors.xml”);

btn2.onRelease = function (loaded) {

if (loaded) {

_root.inventor = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
name_txt.text = _root.inventor;
comment_txt.text = _root.comments;

} else {
trace(“file not loaded!”);

}
}

Insides my scene are two text boxes (‘name_txt’ and ‘comment_txt’) like in Kirupa’s tutorial, but also three buttons, two of which you should ignore (‘inventor 1’ and ‘inventor 3’). There are also some text fields that make up the headings (which stay as they are).

If anyone could take a look at my fla (I’ve attached it along with the xml), I would be very grateful.

Thank You in advance
Mesono