Jump to content
Search Community

Send variable to Timeline with play()

TELLO test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi all,

I guess its simple what I need.

I change with my timeline the color from one element via variable color_01.

.to(hex_06_gradiant_0, {attr:{offset:'0'},stopColor: color_01, ease: 'power4.out'}, 0)

If I call the timeline again with .play(), I want to change the value of color_01.

 

I expected its possible to send the new color with play() like:

function changeColor() {
    let color_01 = offset_02_01;
    let color_02 = offset_02_02;
    tl_menu_color.play(color_01, color_02);
}

But its not working. What is the approach to do this?

 

PS: I found solution to put the whole timeline in a function. 

THX

Link to comment
Share on other sites

  • Solution
9 hours ago, TELLO said:

PS: I found solution to put the whole timeline in a function. 

Yeah, it's almost always cleanest/easiest to just create a new tween (or timeline) rather than trying to take an existing one that already ran and updating its values. 

 

So are you all set now? Let us know if you need anything else. 

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