Hey all,
I’ve got a problem… here’s an example script:
class Example {
var xmlLoader;
function Example (){
this.xmlLoader = new XML();
this.xmlLoader.onLoad = function(){
wannaCallThis();
}
}
function wannaCallThis(){
trace('yay');
}
function loadTheXML(addy:String){
xmlLoader.load(addy);
}
}
Ok, so here’s the problem. What happens in the above, is that I call ‘loadTheXML()’, it loads the xml file into xmlLoader and then runs the event handler ‘onLoad’. My problem is here: once I get into the event handler ‘this’ refers to xmlLoader, not the class. Therefore, I have no way of calling wannaCallThis(). How do I call a member function of the class from inside the eventHandler?
Hope my question was clear. Thanks in advance!