2 Replies Latest reply on Nov 21, 2006 6:22 PM by ntsiii

    Is there a convenient way to handle RemoteObject's result ?

    01robert Level 1
      I want a class with a function like this form:

      MyClass{
      ...
      static var staticObj:Object;
      function static getAObject():Object{
      if (staticObj==null){ staticObj=remoteObject.getObject();}
      return staticObj;
      }
      ...
      }

      There are plenty clients to invoke it:
      ...
      myClientA=MyClass.getAObject()
      ...
      myClientB=MyClass.getAObject()
      ...
      myClientC=...


      In ActionScript, because it is event-driving model, It seemed that I have to split both the MyClass and myClients into two parts: toGetObject() and gottenObject().
      If so, the code become pretty ugly and complex and very difficult to read and write.

      I think there must be a better solution to deal with it . how do you deal with it? Or do I misunderstand it?

      Any suggestion will be appreciated!