1 Reply Latest reply on Mar 14, 2007 8:00 AM by Alan_Ji

    Access public variables in Result Handler method of RemoteObject

    Alan_Ji Level 1
      For example:
      var temp:String = "a";

      public function fnInvokeRemoteObject():void
      {
      remoteObject.method();
      }

      public function fnResultHandler():void
      {
      temp="b";
      Alert.show(temp);
      }

      public function fnPrintTemp():void
      {
      Alert.show(temp);
      }

      At the beginning, set the public variable temp "a". Invoke remote object, in the result handler function of remote object, set temp "b" and print it in the result handler function, "b" can be printed. But after quitting from the result handler function, when I print temp again, I can only get "a". It seems that the variable in result handler is different from the outside public variable.

      problem of asynchronous process? or I should define more detailed scope of variables?
      Anyone could help me to explain that? Thank you.