Hi Everyone
I have an issue with class scope of a .as class. I am using the sendAndLoad
function to send information to a php file. I am sending the info with a
loadVars object and load the info with an XML object. Within the XML object
"onload" function however I can't get a grasp of how to get back to the scope
of the class...
If you have any ideas or thougts on this please let me know. I'd appreciate
it.
Many thanks in advance.
Stephan
Here are the most important parts of the code:
////////////////////////////////////////////////////////////////////////////////
////////////
import com.cityofmemory.CofmConverter;
class com.backend.AddAStory extends com.backend.Scripts{
private var thisObj:AddAStory;
[....]
public function AddAStory(){
[...]
var thisObj=this;
}
[...]
public function sendLocationData(){
recXML = new XML();
recXML.ignoreWhite = true;
sendLV = new LoadVars();
sendLV.variableName = storyData.x;
var thisObj = this;
sendLV.sendAndLoad(SCRIPT,recXML); //the script is defined in the
globalVariables.as
recXML.onLoad = recLocationData;
}
private function recLocationData(success){
trace(thisObj.recXML); //this complies but doeesn't work. traces
undefined
trace(this); //this shows the xml
structure
trace(this.firstChild); //the code does not compile.
Error: this has no properties called firstChild
}
}