Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Timeline

.previousLabel()

.previousLabel( time:Number ) : String

Returns the label name before the time provided. If no time

Parameters

time: Number

The time to get the previous label from.

Returns : String

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

Details

Returns the previous label (if any) that occurs before 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 (“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 previousLabel() in conjunction with tweenTo() to make the timeline tween back to the previous label like this:

  1. myTimeline.tweenTo( myTimeline.previousLabel() );
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.
×