Hi
Flex provides different levels to handle asynchonous calls. I
think you already know, but I am still going to repeat them. Call
can be handle as service result, method result or request result..
example:
Service level
<RemoteObject destination="getMyDataService"
result="handleServiceResult(event)">
method level
<method name="getMyItem"
result="handleMethodResult(event)"/>
request level
var responder1:MyResponder = new MyResponder(datagrid1);
var token1:AsyncToken = remoteObject.getMyItems("all java
books");
token1.responder = responder1;
var responder2:MyResponder = new MyResponder(datagrid2);
var token2:AsyncToken = remoteObject.getMyItems("all
actionscript books");
token2.responder = responder2;
In the request level example, the blocked calls need much
more time to render data in 2 datagrids, but asynchonous one take
advantage to cut the time in half
I cannot say asynchonous call better, but it does have its
merit point, and Flex different levels of handling asynchonous call
make the code easier already for different situations.
If you can provide your scenario which async call is hard to
implement, it would be great to share.
Thanks
William Chan
William Chan