Hi all, I need Your help with something in my code....
Here is my code:
******************************************
Code:
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
public class Controler{
[Bindable]
public var lista:XMLList;
public function consult():XMLList{
var service:HTTPService = new HTTPService();
service.url="http://localhost/Something.php";
service.useProxy=false;
service.resultFormat="e4x";
service.addEventListener(ResultEvent.RESULT, met);
service.send();
Alert.show(lista.length()); //prints 0 =S
return this.lista;
}
private function met(event:ResultEvent):void{
lista = event.result.option as XMLList;
Alert.show(this.lista.length()); //prints the real value, actually: 6
}
}
**********************************************
The thing is: I got data from a database, working fine, in the function met I got the data and the alert.show shows the length of the var lista:XMLList wich is [Bindable] but when i used again in the consult function I got a big 0 (zero) and I dont know what the problem is, some help please...
well I know the problem is that the var lista:XMLList dont make the upgrade but I dont know why...