Despite my best efforts, I am unable to produce the kind of synchronization effects I would like to in ActionScript. The issue is that I need to make several external calls to get various pieces of outside information in response to a user request, and the way items will be laid out on the page is dependent on what each of these external calls returns. So, I don't care that all of these calls return asynchronously. However, is there any way to force some amount of synchronization on ActionScript, so that at least calling the method for doing the final layout and placement of items on the page is dependent on all of my calls finishing?
相关问题
- How to account for clock offsets in a distributed
- Converting Date with Time in PST into UTC format
- Why does the lock insure that the underlying monit
- How do you get Polygons from MovieClips in Flash?
- how to query my database and have it be outputted
相关文章
- Java synchronized block vs concurrentHashMap vs Co
- How does the piggybacking of current thread variab
- C pthread synchronize function
- wait for promises in onbeforeunload
- Can you select which column to sync with Sync Fram
- Libraries for text animation in Flex / Actionscrip
- Waiting for condition in Java
- How to Synchronize SQLServer Database and MySQL Da
If I understand the question right, event listeners are probably your best bet. Most loader classes throw an
Event.COMPLETE
message when they finish doing everything behind the scenes. If you wrote those external calls, it would be easy to dispatch a complete event at the end.So when you make all these external calls, have a function that listens to when those calls complete. This function would keep track of how many calls have been made, and when there's none left to run, continue building your layout.
Rough Sketch to explain below: