I’ve just converted some code to an ActionScript 2 class, and now the XML doesn’t work.
class Menus.DropSlideMenu
{
var _myXML;
public function DropSlideMenu()
{
init();
}
function init()
{
_myXML = new XML();
_myXML.ignoreWhite = true;
_myXML.onLoad = buildMenu;
_myXML.load("myMenu.xml");
}
function buildMenu()
{
trace(_myXML); // returns 'undefined':
}
}
The xml onLoad handler runs but the trace statement returns ‘undefined’.
The .FLA that uses this class looks like this:
import Menus.DropSlideMenu;
mytest = new DropSlideMenu();
Does anyone understand whats going on? I hope this is just a silly error because of the xmas booze.
Thanks.