This content has been marked as final. Show 3 replies
It sounds like (and I'm only guessing here) that you need to you event listeners in your code. For example, the MovieClipLoader class dispatches events when a movie starts loading, while loading, when finished loading, and finally when the movie has be initialized and accessible to actionscript. These are all talked about in the Help files with good examples.
You can also add your own event dispatching to your code by using the mx.events.EventDispatcher class.
Is this what you were looking for?
>> Someone said that there is only one thread in Flash but...
But or no, there is only one thread.
>> When I use setInterval() the code is executed asynchronously.
>> The same happens with event handlers, with the code put in
>> the timeline etc. So there must bu some way of synchronising
Sounds like you've described it.
> You can also add your own event dispatching to your code
> by using the mx.events.EventDispatcher class.
> Is this what you were looking for?
Tim nailed it. Since there is no sleep() function in ActionScript, so
you can modularize your code and run what you need based on events. I
recently blogged on EventDispatcher and AsBroadcaster, so if it's any help
to you, check out ...
stiller (at) quip (dot) net
Dev essays: http://www.quip.net/blog/
"Luck is the residue of good design."
Thanks a lot for help! I'll read some more on this topic and then... maybe I'll have more questions. Thanks