There are at least two issues with the way EventDispatcher is being implemented right now (AS 2.0) -- one is that there is no way to assign priority to your event listener. So if you want to have a listener execute before another, there is no way to do that. Also, if you examine EventDispatcher closely, you will notice that event gets dispatched by looping through the queue list. Using for ( ) construct in Actionscript actually retrieves things in reverse order, so the last thing that gets added to your event queue gets called first.
Here is another interesting scenario with event dispatch. Imagine you have two objects listening to a particular event. Say if the first listener calls gotoAndPlay(), which causes certain movieclips to go out of existence, the second listener that refers to those movieclips will get undefined reference instead. This problem won't exist if the listeners are being called in a different order.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home