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.
Version:
GreenSock Docs
Timeline
.nextLabel()
.nextLabel( time:Number ) : String
Returns the next label in the timeline from the provided time. If no <code>time</code> is provided, the timeline's current playhead time will be used.
Powered by Froala Editor
Parameters
time: Number
The time to get the next label from.
Returns : String

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:
myTimeline.tweenTo( myTimeline.nextLabel() );