Jump to content
Search Community

Stop a TimelineMax Loop at a point before final action.

barrowman test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi

 

Okay hopefully simple.

 

var til = new TimelineMax({repeat:5, repeatDelay:0.1})


til.from(this.UW1, 0.5, {alpha:0, ease: Sine.easeInOut, overwrite: false}, 0.1)
.to(this.UW1, 0.5, {alpha:0, scaleX:1.05, scaleY:1.05, ease: Sine.easeInOut, overwrite: false}, 5)
.from(this.UW4, 0.65, {alpha:0, scaleX:0.95, scaleY:0.95,  ease: Sine.easeInOut, overwrite: false}, 5)
.to(this.UW4, 1.00, {alpha:0, ease: Sine.easeInOut, overwrite: false}, 9)

 

 What I want to do, is on the final play of the loop to stop at 5 seconds, ie NOT do the fade out at 9 seconds. Is this possible in a simple manner? I presume there is a counter that the repeat is accessing, and I just guess I"m not sure how to implement an if command within the timeline as well.

 

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the replies;

 

I did this in the end. Putting a pause function on the timeline, where I wanted it to stop.

til = new TimelineMax({repeat:3, repeatDelay:0.1});

.to(root.Tag_01, 1.00, {alpha:0, ease:Sine.easeInOut, overwrite: false}, 3.0)

.call(function() {if (!til.loop) til.loop = 1; if (til.loop++ == 2) til.pause()})

.to(root.Fader, 0.75, {alpha:1, ease:Sine.easeInOut, overwrite: false}, 12.50)

 

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.
×
×
  • Create New...