2 Replies Latest reply on May 13, 2009 8:46 PM by DigitalSpeciaist

    Create remoteObject with ActionScript, not MXML

    DigitalSpeciaist

      I want to use remoteObject with ActionScript only, no MXML:

       

      private function initializeRemoteObject():void {
                  _remote = new RemoteObject();
                  _remote.source = "AMFProxyObject";
                  _remote.endpoint = "http://localhost/linktoMyAMFServer";
                  _remote.destination = "zend";
                  _remote.showBusyCursor = true;
              }

       

       

      public function getIAllData():void {
                  initializeRemoteObject();
                  var token:AsyncToken = _remote.getAllDataFromStoryTable();
                  //token.result = getDataHandler;

       

      I am stuck here because I don't know the proper syntax to handle the result
              }

       

      private function getDataHandler ()void

           {

      ;//

      }

       

       

      ///////////////    I just want to convert the MXML code below to ActionScript   \\\\\\\\\\\\\\\\\\\\\\

       

       

      <mx:RemoteObject id="zendRemoteObject" destination="zend" source="AMFProxyObject"
              endpoint="http://localhost/linktoMyAMFServer"         
              result="resultHandler(event)">
             
              <mx:method name="getAllDataFromStoryTable" result="getDataHandler(event)"/>
              </mx:RemoteObject>

       

       

      Thanks very much. This is driving me nuts, particularly since I couldn't find any help online by googling.