2 Replies Latest reply on Apr 30, 2011 10:28 AM by NeoRamza2

    How to get the result of a RemoteObject immediately?




      I need to make a function that execute a java method and return his result. It is static becouse a lot of other functions will call this function. So I did this:


          public static function FKDescription(dest:String):String{

      var jRemote:RemoteObject = new RemoteObject();

      var s:String;

      jRemote.destination = dest;




      function valresult(event:ResultEvent):void{

      s = event.result as String;



      return s;




      But the function returns null, because the valresult() was not been called at the end of main function. What shoud I do to make FKDescription() return the string that came from remoteobject?