import mx.collections.ArrayCollection;
import mx.collections.ItemResponder;
import mx.controls.Alert;
import mx.rpc.AsyncToken;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
[Bindable]
private var myData:ArrayCollection
private var contactService:HTTPService = new HTTPService();
private function getData():void{
contactService.url="contacts.xml";
var responder:ItemResponder = new ItemResponder(resultHandler,faultHandler);
var token:AsyncToken = contactService.send();
token.addResponder(responder);
}
private function resultHandler(event:ResultEvent, token:AsyncToken):void{
myData = event.result.contacts.row;
}
private function faultHandler(event:FaultEvent, token:AsyncToken):void{
Alert.show(event.fault.faultString, event.fault.faultCode);
}