Is it true that in the flash/air player the actionscripts are all run in a single thread? Are all those event listeners invoked one by one and never overlap? If not, is there a way I can worry about it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
AFAIK, in ActionScript a block of code is always single threaded. i.e. it always blocks the execution of others until finished. If I am not mistaken the only time the Flash runtime executes code in a separate thread is when it is making network calls.
In the AS event model, the events do not overlap; i.e. there is no way two event listeners will be called simultaneously. They will always be executed one after the other; and this holds even for events resulting from network calls.
You would have a hard time estimating the order of the events in the cases where you have many separate events however; because most of the event model is tightly integrated to the display list. In such cases it would be best to devise some kind of a queue system first.