Scope in classes

I tried to experiment some xml parsing stuffs and found that interesting link about scope in classes @adobe:

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001662.html

Now in this example on the onload function, they use:
prodXml.onLoad = function(success:Boolean) {
if (success) {
/
If the XML successfully loads and parses,
set the class’s m_products_xml variable to the parsed
XML document and call the init function. /
thisObj.m_products_xml = this;
thisObj.init();
} else {
/
There was an error loading the XML file. */
trace(“error loading XML”);
}
};

Can I create a simple function then call it while using a delegate class to solve the scope
issue instead??

ex:
function parseXML (success:Boolean)
{
if (success) {
thisObj.m_products_xml = this;
thisObj.init();
} else {
trace(“error loading XML”);
}
}
then use:
prodXml.onLoad = Delegate.create(this, parseXML);

While experimenting it, since “thisObj” is declared in local constructor
it won’t recognize in this function. If I declared as a global variable
I got that error msg from the compiler:

“Type mismatch in assigment statement: found com.parseXML where XML is required…”

btw, I put the as file in com directory and .fla outside of com directory though

thanks in advance!