Calling RemoteObject components in ActionScript : RemoteObject « Development « Flex






Calling RemoteObject components in ActionScript

        

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    
    import mx.controls.Alert;
    import mx.rpc.remoting.RemoteObject;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;
    [Bindable]
    public var empList:Object;
    public var employeeRO:RemoteObject;

    public function useRemoteObject(intArg:int, strArg:String):void
    {
      employeeRO = new RemoteObject();
      employeeRO.destination = "EmpManager";
      employeeRO.getList.addEventListener("result",getListResultHandler);
      employeeRO.addEventListener("fault", faultHandler);
      employeeRO.getList("AAA");
    }
    public function getListResultHandler(event:ResultEvent):void {
      empList = event.result;
    }
    public function faultHandler (event:FaultEvent):void {
      Alert.show(event.fault.faultString, 'Error');
    }
  </mx:Script>
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Feed returning value from RemoteObject to DataGridFeed returning value from RemoteObject to DataGrid
2.Call remote method with RemoteObjectCall remote method with RemoteObject
3.Convert returning value from RemoteObject to ArrayCollectionConvert returning value from RemoteObject to ArrayCollection
4.Pass bounded parameters to RemoteObjectPass bounded parameters to RemoteObject
5.RemoteObject Result EventRemoteObject Result Event
6.RemoteObject With BindingsRemoteObject With Bindings
7.Remote Object Explicit ArgumentsRemote Object Explicit Arguments
8.Remote Object with Multiple MethodsRemote Object with Multiple Methods