Skip to main content

nextLabel

nextLabel( time:Number ) : String

Returns the next label in the timeline from the provided time. If no time is provided, the timeline's current playhead time will be used.

Parameters

  • time: Number

    The time to get the next label from.

Returns : String

Name of the label that is after the time passed to nextLabel(). If no time is provided, the timeline's current playhead time will be used.

Details

Returns the next label (if any) that occurs after the time parameter. If no time is provided, the timeline's current playhead time will be used. It makes no difference if the timeline is reversed ("after" means later in the timeline's local time zone).

A label that is positioned exactly at the same time as the time parameter will be ignored.

You could use nextLabel() in conjunction with tweenTo() to make the timeline tween to the next label like this:

tl.tweenTo(tl.nextLabel());