I am having some difficulties loading XML from an external class. I would like to place the firstChild into a Dynamic Text Box. In my Flash movie the text box is labeled LevelTitle. This is my code at the moment:
class SelectTest extends XML {
var Testlist: XML;
var curContainer:XMLNode
function SelectTest() {
var Testlist = new XML;
Testlist.load("TestList.xml");
Testlist.ignoreWhite = true;
Testlist.onLoad = getTest()
}
function getTest() {
trace ("success");
var LevelTitle= Testlist.firstChild
trace (LevelTitle);
}
}
It always traces “sucess” leading me to believe that the xml is loading successfully, but when I try to trace LevelTitle, (or Testlist.firstChild, or Testlist.toString()) I always get undefined. What am I doing wrong?