purtroppo no xk con "this instance of LoadVars" restituisce true mentre "this istanceof myClass" restituisce false!
![]()
![]()
ecco qui:
Codice PHP:class myClass{
private var dataLoaded:Boolean;
private var dataLoader:LoadVars;
//costruttore
function myClass() {
this.dataLoaded = false;
this.dataLoader.onLoad = this.onLoader;
//LoadVars.prototype.path = 0;
dataLoader.path = this;
}
//carica i dati dal php
private function loadVars() {
this.dataLoader.load(this.dataURL);
}
//funzione richiamata quando sono stati caricati correttamente i dati
private function onLoader(success) {
/**qui dentro this si riferisce all'oggetto dataLoader??**/
//trace(this.dataLoaded);
//this.dataLoaded = success;
if (success) {
trace("dati caricati");
//this.dataLoader.path.foo();
trace("dati caricati2");
}
}
//imposta la sorgente dei dati
public function setSourceAndLoad(dURL:String):Void {
this.dataURL = dURL;
this.loadVars();
}
private function foo() {
trace("the foo function is called");
}
}

Rispondi quotando