Jump to content
Search Community

Tweening Multiple Elements Simultaneously

pfash test
Moderator Tag

Go to solution Solved by PointC,

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

Hi All,

Likely this is a simple answer but I'm unfamilar and just not using the correct terms when searching:

 

I want two movie clips to tween at the same time. The code below just makes the movie clips tween one right after the other..not simultaneously.

tl = new TimelineMax({paused:true, reversed:true});
TweenLite.defaultEase = Elastic.easeInOut;

tl.to(stage.movieClip1, 1.3,{scaleX:1.3,scaleY:1.3, x: '+=30'}).to (stage.movieClip2, 1.3,{scaleX:1.5,scaleY:1.5, y: '-=60', x: '+=40'});

Thanks much!

Link to comment
Share on other sites

  • Solution

Hi pfash  :)

 

You need to use the position parameter.

tl.to(stage.movieClip1, 1.3,{scaleX:1.3, scaleY:1.3, x: '+=30'});
tl.to(stage.movieClip2, 1.3,{scaleX:1.5, scaleY:1.5, y: '-=60', x: '+=40'}, 0); // the zero tells this tween to start at time 0

More info:

 

https://greensock.com/position-parameter

 

Hopefully that helps.

 

Happy tweening.

:)

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