Jump to content
GreenSock

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

Spool to a Part in a Timeline

Recommended Posts

Is it possible to spool to a certain part in a timeline and play forward (or backward) from there?  Like setting a flag and on init() calling a flag on that part of the animation (e.g. init("thirdPart"))?  I ask this, because I need to debug and right now, I have to sit through the full animation to check the end.  Would save a lot of time.

 

Thanks,

 

-Stefan

 

 

See the Pen xGQaOE by hyperbola (@hyperbola) on CodePen

Link to comment
Share on other sites

Hey sjerrentrup,

 

I think you may also be asking about seek. Once you add the label as Diaco has suggested you can them simply jump to it by using tl.seek("yourLabel")or you can also jump by time: tl.seek(2) will jump to 2 seconds.  :-)

  • Like 1
Link to comment
Share on other sites

If this is just for debugging, you can issue commands via the console to get where you need to be.

 

Examples:

 

tl.pause();

tl.progress(.75);

tl.play();

tl.reverse();

Link to comment
Share on other sites

All the answers above are great and work fine.

 

Definitely check out the docs and see that play(), reverse() and resume() all take a from parameter

 

.play( from:*, suppressEvents:Boolean ) : *

Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is).

 

from : *

(default = null) — The time (or label for TimelineLite/TimelineMax instances) from which the animation should begin playing (if none is defined, it will begin playing from wherever the playhead currently is).

 

//begins playing from wherever the playhead currently is:
myAnimation.play();
//begins playing from exactly 2-seconds into the animation:
myAnimation.play(2);
//reverse from the "news" label
myAnimation.reverse("news");

http://greensock.com/docs/#/HTML5/GSAP/TimelineLite/play/

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×