Jump to content


Assigning variable to Tween Object

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

Hey there. 


In my Project I use allot of Tweens. At a specific point it wish to reset all current tweens excluding a select few. I wish to store a variable on these Tween to exclude so when resetting all the current tweens these can be tracked an avoided. I've tried this sofar but when assigning the failed tag SStimer return undefined. Yet I can access this tween when using TweenMax.getAllTweens()[index]. Am i Missing something major here? 

           trigger.SStimer = new TimelineMax({delay: 180})
            .call(function () {
                console.log('Slow selection fired');
                delete this

            trigger.SSTimer.failedTag = true;
Link to comment
Share on other sites

Sorry, but I'm having difficulty understanding your problem and how the code you provided relates. 

I believe a simple CodePen demo would be very helpful: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/


You mentioned flagging tweens but you seem to be trying to assign a variable to a timeline.


I believe you should be ok adding a custom data object to your tween like


var t = TweenLite.to("h2", 3, {x:200, data:{isSafe:true}});

console.log("isSafe = " + t.vars.data.isSafe);
  • 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.