Jump to content

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

how to change a tween without breaking the animation?

Recommended Posts



in essence my problem is as follows: i have an movieclip and a button, if you click the button the mc moves 100px to the left. what i want is: i want to be able to click the button again while the mc is already moving, so the mc would end up 200px to the left. so i think i somwhow need to update the tween on the mc with a differen target position. i konw i could just replace the already running tween but then the animation would look bad since i am using easing for the movement.

how can i update the tween with a new tartget position without screwing the animmation?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,


It sounds like TweenMax.updateTo() will suit your purposes.


If you need to update your tween constantly check out the DynamicPropsPlugin example: http://greensock.com/tweenmax-as 

DynamicPropsPlugin is a bonus plugin for Club GreenSock members: http://greensock.com/club/

Link to comment
Share on other sites

thx for the answer. unfortunately it doesnt work as i would like it to. the thing is, for easing i use Quad.easeInOut so when i call updateTo() the mc moves to the right coordinates but the easing (accelerating and decelerating) starts all over again and this is exactly what i meant by "breaking the animation". so what happens is: i click the button, mc starts to accelerate, i click the button again, mc stops and starts to accelerate again. Is there a way to have a smooth transition there?

Link to comment
Share on other sites

  • 2 years later...

seeking the same as hemmoleg asked quite a few years ago :)


I'm also changing direction (zoom in/out) and the

updateTo does not solve - guess we seek a more physical behavior with deacceleration+acceleration when changing midtween.

Link to comment
Share on other sites

It sounds like you are looking for additive animation, which will allow you to blend 2 animations in opposing directions together.

Play with this demo here: http://codepen.io/osublake/pen/PPmJpL/


Very informative post here with some interesting ideas and demos: https://greensock.com/forums/topic/12573-additive-animation/


The good news: decent chance this will be possible in the JS version of GSAP

Bad news: we have no intention of doing anything with the ActionScript tools. The codebase hasn't been touched in a few years as demand is so low. 

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.