Jump to content
GreenSock

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

TimelineMax - seek(mylabel) - firing all onComplete events

Recommended Posts

I don't know. What am I doing wrong?
 

 

My code is essentially like this:
var tl = new TimelineMax({paused:true})
tl.to($("#pin"), 1, {x:455,y:198, onComplete:myFunction, onCompleteParams:["params"]}) 
.addLabel("play_from_here") 
.to($("#pin"), 1, {x:737,y:307}) 

tl.play(play_from_here)
 
 
 

 

using play(), resume(), seek(), it doesn't matter, it always trigger all events on the way.

 

Link to post
Share on other sites

And using call(myfunction) instead of oncomplete event, do the same. 

Link to post
Share on other sites

Hi Giovani and welcome to the GreenSock forums.

 

Some methods, seek() among them, have a second parameter, a boolean to be more specific, which indicates whether callbacks should be ignored or not. By default this is false, so the engine should ignore any callbacks during the seek, so your code should work as you expected.

 

http://api.greensock.com/js/com/greensock/core/Animation.html#seek()

 

So there's two thing to consider, first be sure that you're using the latest version of the engine and second please provide a reduced sample in codepen in order to see what could be the issue:

 

http://forums.greensock.com/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

Rodrigo.

  • Like 1
Link to post
Share on other sites

Thanks, Rodrigo.

 

It seems though that Giovani did uncover a regression that slipped in with version 1.12.0.

The short story is that when tweens that weren't yet initialized were sent off to be "lazy" rendered, their events were not being suppressed properly.

 

The good news is, there is now a fix in place in version 1.13.2 (attached)

 

Giovani,

 

Sorry for the hassle and thanks for reporting the issue.

Here is a very basic CodePen example that uses a pre-release of 1.13.2.

http://codepen.io/GreenSock/pen/c89d9dcd4a95817dcaa0fb099a290a58?editors=001

 

Very similar to your code and you will see that events are now properly being suppressed.

 

Please grab the pre-release version of 1.13.2 (below) and test with your code.

If you find errors, please fork the codepen demo I provided so that we can quickly hunt them down. We've tested and I'm confident it should work properly.

 

Thanks and sorry again for the trouble.

 

 

Edit: in methods like pause(), play(), seek(), time() the suppressEvents parameter is true by default.

TweenMax-1-13-2-preview.js.zip

  • Like 1
Link to post
Share on other sites

What I am doing is basically like that:

 

See the Pen FbozA by anon (@anon) on CodePen

 

But after a couple of non sleeping nights, I figured out that using the version 1.11.0 it doesn't happen

 

Both seek("myLabel") and play("myLabel") suppress the events like expected.

 

 

Link to post
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.

×