import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; public function initApp(): void { // This var holds the data we want to pass to the remote service. var param:String = "Hello World!"; // Call remote service to fetch data remoteObj.echo( param ); } // Result handler method private function onResult( re:ResultEvent ): void { var myData:String = re.result as String; trace( myData ); // prints "Hello World!" status_txt.text = myData; } // Fault handler method displays error message private function onFault( fault:FaultEvent ): void { // Notify the user of the problem status_txt.text = "Remoting error: \n"; for ( var d:String in fault.fault ) { status_txt.text += fault.fault[d] + "\n"; } }