Jump to content
Search Community

get last dispatched ticker priority?

erikb 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

Is there a way to query the ticker for the priority (.pr) of the last dispatched event?

This would be real helpful at times.. especially when dispatching custom events before and after tweens and wanting to know where we are in the series of events.


For example, would want to be able to query TweenMax.ticker if I am at priority -100 or 100 from when these are fired:

TweenMax.ticker.addEventListener('tick', preComponentPaintCb, this, false, -100 );

TweenMax.ticker.addEventListener( 'tick', postComponentPaintCb, this, false, 100 );


My research suggests this information is not available... and if I wanted to add it, I would so hereabouts:


by adding something like

this.lastPr = listener.pr;


Help and suggestions appreciated.  I've a related question but will hold on until I get some feedback on this one :-)  Thanks!

Link to comment
Share on other sites

Sorry, @erikb, that information is not available. You're correct.


It should be relatively easy, though, to distinguish by structuring your function calls accordingly. You could even create a function to help you:

function createListener(func, priority, scope) {
    TweenLite.ticker.addEventListener("tick", function() {
        func.call(scope, priority);
    }, this, false, priority);

createListener(preComponentPaintCb, -100, this);
function preComponentPaintCb(priority) {
    console.log("priority: ", priority);



  • Like 2
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...