Class: Timeline

Timeline

The Timeline class represents a series of tweens, tied to keyframes.

Members

target AnimateDisplayObject

The target DisplayObject.

Methods

Timeline.create (target) Timeline static

Creates a new Timeline. Must be used instead of a constructor because extending the Array class is a pain: https://blog.simontest.net/extend-array-with-typescript-965cc1134b3

Name Type Description
target AnimateDisplayObject

The target for this string of tweens.

Returns:
Type Description
Timeline A new Timeline instance.

addKeyframe (properties, startFrame, duration) void

Add a single keyframe that doesn't tween. Note that this has some capability to insert keyframes into the middle of a timeline, in order to handle how masks are published, it should only be relied upon to add keyframes to the end of a timeline.

Name Type Default Description
properties TweenProps

The properties to set.

startFrame number

The starting frame index.

duration number 0

The number of frames to hold beyond startFrame (0 is single frame)

addTween (tween) void

Adds one or more tweens (or timelines) to this timeline. The tweens will be paused (to remove them from the normal ticking system and managed by this timeline. Adding a tween to multiple timelines will result in unexpected behaviour.

Name Type Description
tween TweenProps

The tween(s) to add. Accepts multiple arguments.

extendLastFrame (endFrame) void

Extend the last frame of the tween.

Name Type Description
endFrame number

The ending frame index.