Jump to content
Search Community

Timeline not playing anything added at time zero in certain cases

CraptainRob 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

During my last upgrade it appears that a problem was introduced that's causing most of my timelines to not play any item added at zero time. It seems to only happen with a very specific set of circumstances, but that also happens to affect almost every timeline in my project.
 
Here is a code example that will cause the problem...

 

var test = new TimelineLite({ paused: true });

test.add(function () {
    return console.log("ONE");
});

test.add(function () {
    return console.log("TWO");
}, 1);

test.add(function () {
    return console.log("THREE");
});

 

// FIRST PLAY WILL SKIP "ONE"
TweenLite.delayedCall(4, function () {
    return test.play(0);
});

 

// SECOND PLAY WILL NOT SKIP "ONE"
TweenLite.delayedCall(6, function () {
    return test.play(0);
});

 

The output you will see from the first delayedCall is...

TWO

THREE

and then for the second delayedCall...

ONE

TWO

THREE

 

The last version that worked was 1.9.1 (I upgraded from 1.8.3 this morning). In 1.9.1 it will always show ONE on the first play. In versions 1.9.2 - 1.9.5 it fails to show ONE on either the first or second delayedCall. Starting with version 1.9.6 (which is labeled 1.9.5 btw) through the current 1.10.4 we see the current behavior of skipping ONE the first time and showing ONE the second time.

 

In order for this to happen the timeline must be constructed as paused, must have a call with a time param (see TWO), and must be played after a delay.

 

Thanks in advance for your help.

Link to comment
Share on other sites

  • 2 weeks later...

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...