Breen
Legacy Member
Mijn verontschuldigingen voor het Engels, deze Thread is ook gestart op het Macromedia Flash forum
The code I attached (section 1) is how i used to write XML parsing. First you define what should happen when the object is loaded, then do you call the "sendAndLoad()". But i want to add this functionality to an XML parser class that returns the object after it is loaded...
I tried translating it, but got stuck (code section 2)
Any idea how i can translate this correctly to AS 2.0 classes with a method that handles this functionality? thx
The code I attached (section 1) is how i used to write XML parsing. First you define what should happen when the object is loaded, then do you call the "sendAndLoad()". But i want to add this functionality to an XML parser class that returns the object after it is loaded...
I tried translating it, but got stuck (code section 2)
Any idea how i can translate this correctly to AS 2.0 classes with a method that handles this functionality? thx
Code:
////////////////////////////////////////////////////////
// Section 1 //
////////////////////////////////////////////////////////
var objXML:XML = new XML();
var snl:LoadVars = new LoadVars();
objXML.onLoad = function() {
//do something
}
snl.sendAndLoad("getsomething.php",objXML,"POST")
////////////////////////////////////////////////////////
// Section 2 //
////////////////////////////////////////////////////////
function getItems():Array {
var retArr:Array;
this.objXML.onLoad = function() {
retArr = XMLparser.getInstance().parseXML(this);
};
externalLoad.sendAndLoad("getItems.php", this.objXML, "POST");
return retArr;
}
Maar altijd leuk te weten dat je een oplossing hebt gevonden.