Jump to content



.getLabelBefore( time:Number ) : String

Returns the previous label (if any) that occurs before the time parameter.


time: Number

(default = NaN) — Time before which the label is searched for. If you do not pass a time in, the current time will be used.


Returns : String

Name of the label that is before the time passed to getLabelBefore()


Returns the previous label (if any) that occurs before the time parameter. It makes no difference if the timeline is reversed ("before" means earlier 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 getLabelBefore() in conjunction with tweenTo() to make the timeline tween back to the previous label like this:

myTimeline.tweenTo( myTimeline.getLabelBefore() );
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.