Timeline class

Note: This class is not intended to be used directly. It is needed by the 'Toolkit for Dart' to export from Flash Professional to Dart/StageXL.

Constructors

Timeline(List<TimelineTween> tweens, Map<String, int> labels, Map<String, dynamic> props)
The Timeline class synchronizes multiple tweens and allows them to be controlled as a group. Please note that if a timeline is looping, the tweens on it may appear to loop even if the "loop" property of the tween is false. @class Timeline @param tweens An array of Tweens to add to this timeline. See addTween for more info. @param labels An object defining labels for using gotoAndPlay/Stop. See {{#crossLink "Timeline/setLabels"}}{{/crossLink}} for details. @param props The configuration properties to apply to this tween instance (ex. {loop:true}). All properties default to false. Supported props are:

Properties

duration ↔ num
Read-only property specifying the total duration of this timeline in ticks. This value is usually automatically updated as you modify the timeline. See updateDuration for more information.
read / write
ignoreGlobalPause ↔ bool
Causes this timeline to continue playing when a global pause is active.
read / write
loop ↔ bool
If true, the timeline will loop when it reaches the end. Can be set via the props param.
read / write
onChange ChangeHandler
Called, with a single parameter referencing this timeline instance, whenever the timeline's position changes.
read / write
position ↔ num
Read-only. The current normalized position of the timeline. This will always be a value between 0 and duration. Changing this property directly will have no effect.
read / write
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addLabel(String label, num position) → void
Adds a label that can be used with gotoAndPlay/Stop. @param label The label name. @param position The position this label represents.
addTween(TimelineTween tween) TimelineTween
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. @param tween The tween(s) to add. Accepts multiple arguments. @return TimelineTween The first tween that was passed in.
gotoAndPlay(dynamic positionOrLabel) → void
Unpauses this timeline and jumps to the specified position or label. @method gotoAndPlay @param positionOrLabel The position in ticks or label to jump to.
gotoAndStop(dynamic positionOrLabel) → void
Pauses this timeline and jumps to the specified position or label. @method gotoAndStop @param positionOrLabel The position in ticks or label to jump to.
removeTween(TimelineTween tween) → bool
Removes one or more tweens from this timeline. @param tween The tween(s) to remove. Accepts multiple arguments. @return Boolean Returns true if all of the tweens were successfully removed.
resolve(dynamic positionOrLabel) → num
If a numeric position is passed, it is returned unchanged. If a string is passed, the position of the corresponding frame label will be returned, or null if a matching label is not defined. @param positionOrLabel A numeric position value or label string.
setLabels(Map<String, int> o) → void
Defines labels for use with gotoAndPlay/Stop. Overwrites any previously set labels. @param o An object defining labels for using gotoAndPlay/Stop in the form {labelName:time} where time is in ticks.
setPaused(bool value) → void
Pauses or plays this timeline. @param value Indicates whether the tween should be paused (true) or played (false).
setPosition(num value, [ int actionsMode ]) → bool
Advances the timeline to the specified position. @param value The position to seek to in ticks. @param actionsMode Optional parameter specifying how actions are handled. See TimelineTween.setPosition for more details. @return Boolean Returns true if the timeline is complete (ie. the full timeline has run & loop is false).
tick(num delta) → void
Advances this timeline by the specified amount of time in ticks. This is normally called automatically by the TimelineTween engine (via TimelineTween.tick), but is exposed for advanced uses. @param delta The time to advance in ticks.
toString() → String
Returns a string representation of this object. @method toString @return {String} a string representation of the instance.
updateDuration() → void
Recalculates the duration of the timeline. The duration is automatically updated when tweens are added or removed, but this method is useful if you modify a tween after it was added to the timeline. @method updateDuration
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited