function loadMenuData(datafile) { this.XML = new XML(); this.XML.ignoreWhite = true; this.XML.load(datafile); this.XML.owner = this; // create reference to the owner object this.XML.onload = this.readXML; } function readXML() { this.owner.menu_xml = this; onXmlRead(); } function onXmlRead() { trace("this.items = " + this.menu_xml.items); trace("ABC = " + this.menu_xml.ABC); trace("ABC children = " + this.menu_xml.ABC.childNodes); trace("ABC first image = " + this.menu_xml.ABC.childNodes[0]); } function main() { loadMenuData("items.xml"); } main();