1 Reply Latest reply on Oct 15, 2008 9:48 AM by Newsgroup_User

    RemoteObject Flow Question

    UberError
      Hi,

      Example:

      var i:int = 0;
      myRO.someMethod(); // where myRO is a RemoteObject
      i = 1;

      As many of you may know "i" may be set to 1 BEFORE someMethod() completes its query. I was wondering if there's something I'm missing to prevent this so that it behaves more like any other OOP languages (where the following statements wait for the function to return). Currently I would place the i =1; in my resultFunction to make sure things flow correctly, however, it makes me end up going back and forth in the code to see whats going on, and in some instances would be much easier to traverse the code if it executed in order.

      Any ideas would be appreciated.

      Thanks!
        • 1. Re: RemoteObject Flow Question
          Level 7

          "UberError" <webforumsuser@macromedia.com> wrote in message
          news:gd563f$dc4$1@forums.macromedia.com...
          > Hi,
          >
          > Example:
          >
          > var i:int = 0;
          > myRO.someMethod(); // where myRO is a RemoteObject
          > i = 1;
          >
          > As many of you may know "i" may be set to 1 BEFORE someMethod() completes
          > its
          > query. I was wondering if there's something I'm missing to prevent this so
          > that
          > it behaves more like any other OOP languages (where the following
          > statements
          > wait for the function to return). Currently I would place the i =1; in my
          > resultFunction to make sure things flow correctly, however, it makes me
          > end up
          > going back and forth in the code to see whats going on, and in some
          > instances
          > would be much easier to traverse the code if it executed in order.

          Specify a result handler and set i there.