so far as I know, calling remoting service (Remote object) is asynchronous , 
however URLStream is not asynchronous.

if the data on Flex are streamed as AMF in URLStream,compare this data service 
with remoting server, how about is the performance?
below is the code:

public function loadData():void{
        
                var url:String = "http://abc.com/ProcessServlet?id=3";;
                var request:URLRequest=new URLRequest(url);
                request.method=URLRequestMethod.GET;
                var urlStream:URLStream =new URLStream();
                urlStream.addEventListener("complete", handleDataShow)
                urlStream.addEventListener("ioError", loadDataError)
                try     {
                        urlStream.load(request);
                        }catch (error:Error){
                                Alert.show(error.toString());
                                }

                        }
                        
private function handleDataShow(event:Event):void{
                 var urlStream:URLStream=URLStream(event.target);
                 var byte:ByteArray=new ByteArray;
                 urlStream.readBytes(byte, byte.length);
                 byte.uncompress();
                 var obj:Contact =byte.readObject() as Contact;
                 }

Reply via email to