The playhead

As the previous section mentioned, the playhead is now moved after the enter frame event has been dispatched. This is not the only change in as 3. In movies published for flash player 9, the gotoAndPlay method and family also follows the new event order; The playhead is not moved when the method returns, it is moved during the playhead move step in the rendering loop.

As Adobe eventually realized, this is stupid and causes a lot of issues for people who want to access the instances directly after the method returns, this behavior was mostly scrapped in FP 10. Do note that you must publish for FP 10 to get the fixed behavior; the"old"ť behavior is kept for FP 9 published movies for compability reasons.

When I said "mostly scrapped"ť, I meant that the behavior is not fully scrapped. If you move the playhead of a child instance, the behavior is fixed, but if you move your own timeline, the old behavior remains.

One thing that may not be clear is when exactly the content of a Movieclip is instantiated for the very first frame. You can define a custom class for MovieClip symbols. If you do, you can choose when the content is created. The content is created when the constructor for the Sprite base class runs. And you can choose when to run the constructor for your base class simply by simply explicitly calling it.

Summary

The new event system has brought in a new set of issues for programmers that work with timelines. Old methods no longer work as expected and old behavior has been replaced and then undone. While it is clear that some of the changes were not properly reviewed, the end result is actually better than previously. We now have more places in the rendering loops where we can run code opposed to previously.