Remote Object with Multiple Methods : RemoteObject « Development « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Development » RemoteObjectScreenshots 
Remote Object with Multiple Methods
Remote Object with Multiple Methods
         
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      
      [Bindable]
      private var statesData:ArrayCollection;
      [Bindable]
      private var helloString:String;
      
      private function arrayHandler(event:ResultEvent):void
      {
        statesData = event.result as ArrayCollection;
      }
      private function helloHandler(event:ResultEvent):void
      {
        helloString = event.result as String;
      }
  
  </mx:Script>
  
  <mx:RemoteObject id="myRemoteObject" destination="helloClass" result="arrayHandler(event)">
    <mx:method name="helloWorld" result="helloHandler(event)"/>
    <mx:method name="getArray" result="arrayHandler(event)"/>
  </mx:RemoteObject>
  
  <mx:Button label="Get String" click="myRemoteObject.helloWorld()"/>
  <mx:Label text="{helloString}" fontSize="14"/>
    
  <mx:Button label="Get Array" click="myRemoteObject.getArray()"/>
  <mx:DataGrid dataProvider="{statesData}"/>
  
</mx:Application>

   
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Feed returning value from RemoteObject to DataGridFeed returning value from RemoteObject to DataGrid
2.Calling RemoteObject components in ActionScript
3.Call remote method with RemoteObjectCall remote method with RemoteObject
4.Convert returning value from RemoteObject to ArrayCollectionConvert returning value from RemoteObject to ArrayCollection
5.Pass bounded parameters to RemoteObjectPass bounded parameters to RemoteObject
6.RemoteObject Result EventRemoteObject Result Event
7.RemoteObject With BindingsRemoteObject With Bindings
8.Remote Object Explicit ArgumentsRemote Object Explicit Arguments
www__.j___a__v_a_2s._c__o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.