The TimelineWatcher class is a small, simple utility class. Here is the full documentation:
TimelineWatcher(timeline:MovieClip): Creates a TimelineWatcher
object to watch a single timelinedispose():void: Removes the TimelineWatcher
object's internal listeners and references, so it can be garbage collected
without any memory leakslabelReached: Dispatched when a new timeline label has been reached| Event Object Type: | com.refunk.events.TimelineEvent |
| Event.type property: | com.refunk.events.TimelineEvent.LABEL_REACHED |
| Custom property/value: | currentFrame: The current frame (int)currentLabel: The current timeline label (String)
|
endReached: Dispatched when the end of a timeline has been reached| Event Object Type: | com.refunk.events.TimelineEvent |
| Event.type property: | com.refunk.events.TimelineEvent.END_REACHED |
| Custom property/value: | currentFrame: The current frame (int)currentLabel: The current timeline label (String)
|
Because the TimelineWatcher class extends the built-in
EventDispatcher class you can add event listeners using the standard addEventListener() method. It goes
hand-in-hand with the TimelineEvent class, which is a custom event class that
explicitly types the events used by TimelineWatcher. These events
additionally store the current frame number and label, so they can be retrieved
via the event object.
You can find the TimelineWatcher and TimelineEvent classes in the sample file for this article (timelinewatcher.zip). Both classes are made available as free code by Refunk and are distributed under the GNU General Public License.