Sometimes you want to play a sequence of animation using movie-clips – this implies that you need to detect when is the end of the clip in question. You can place a variable inside the movie clip inside, but with ActionScript 3 there is another solution – using the enter frame event of the movie clip to run a function, which then proceed to check if the movie clip has reached its final frame (or any frame, for that matter). This solution is discussed at the lower half of the article at Flash&Math.
With some work, one should be able to write an observer pattern for this.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Singapore License.












