Hi. I appreciate the help!
I have a class with a XML object in it. In one of the class’ methods, I tell the XML object to load a document. Before I do that, I set up the onLoad event to call one of the class’ other methods. The problem is that in that handler function, I can’t seem to access any of my class’ data. If I try to use the “this” pointer, I’m getting the XML object not my class.
A simple example:
[AS]
class MyClass
{
var theXML:XML;
var someVariable:Number;
function MyClass()
{
theXML = new XML();
theXML.onLoad = XMLLoadHandler;
theXML.load( “testFile.xml” );
}
function XMLLoadHandler(success)
{
// This function gets called when the XML is done parsing,
// but I can’t access any of the data or methods in this class!!
// What do I need to do?
trace(someVariable); // does not exist
}
}
[/AS]
Thanks!!