actionscript 3 - Is there an generic way to synchronize multiple asynchronous results in Flex? -
I was wondering if we have a native or normal way of synchronizing many results from asynchronous HTTPPSVice calls in Adobe Flex . In other words, I need to recover some data from my server and execute the function, when I retrieve all the data from these different functions.
Here's an example:
private var mObj01: object = null; Private var mObj02: object = zero; Private var mObj03: object = null; Public Function TryLoadSynchronousFunction (): Zero {if (mObj01! = Null & amp; mObj02! = Faucet & amp; amp; MBBJ 03! = Faucet) DoSynchronizedStuff (); } Public Function GetObj01 (Event: ResultEvent): Object as zero {mObj01 = event.result; TryLoadSynchronousFunction (); } Public Function GetObj02 (Event: ResultEvent): The object as zero {mObj02 = event.result; TryLoadSynchronousFunction (); } Public Function GetObj03 (Event: ResultEvent): Object as zero {mObj03 = event.result; TryLoadSynchronousFunction (); } Public Function StartAsynchronous (): Zero {myCall01.token = httpObj.Get01 (); MyCall02.token = httpObj.Get02 (); MyCall03.token = httpObj.Get03 (); and and at me: & lt; Mx: collarsponder id = "MyCall01" result = "GetObj01 (event)" /> & Lt; Mx: collarsponder id = "myCall02" result = "getObj02 (event)" /> & Lt; Mx: collarsponder id = "myCall03" result = "GetObj03 (event)" / & gt; Is there a better way for such a situation?
To get started, callresponder is fine in demo code (like Adobe offers demo) , But in reality - this is not a good implementation within an application. You need to create some service representatives who handle all your conversations with the server:
Its Besides, I would advise to see something like the Channing API with Swiss asynchronous Framework as an alternative to unite a group of Yon
Comments
Post a Comment