Jump to content
Search Community

Dynamic variables in TimelineMax/Lite

robertnyc test
Moderator Tag

Recommended Posts

How do you make Timelines dependent on dynamic variables?

 

That is, let's say you set up a timeline such as

 

_myTimeline.insert(new TweenMax(myObj,1,{x:someIntegerVariable}));

 

and let's say, for instance, that you set someIntegerVariable based on a mouseDown -- so that you want myObj to tween to where the mouse click is (this is all pseudo code/bogus example, but just for illustration). For me, the timeline doesn't "know"to update when the underlying variables change. That is, it will always tweeen to whatever someIntegerVariable was when the timeline was set up originally.

 

_myTimeline.invalidate() doesn't seem to help --

 

Or am I doing something wrong?

Link to comment
Share on other sites

That's exactly what the dynamicProps plugin is for. See an interactive example in the Plugin Explorer. It's only available for Club GreenSock members, though - http://www.greensock.com/club/

 

This is a rather complex thing to accommodate, especially because of the easing that must be factored in and several other factors. But dynamicProps indeed works well. Also, keep in mind that dynamicProps can't really run backwards like in a reversed tween or timeline because the end value is what's always being recalculated.

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