Jump to content
Search Community

TimelineMax Offset & Repeat

Amnesicat test
Moderator Tag

Recommended Posts

Hi

 

Just wondering if someone might know a solution to my problem (see code below). The whole

tween works fine on the first run, but when it repeats the movieclips seem to act strange and

jump to the 120 y position straight away. Now I know it's because of the 0.3 offset, I just

thought someone might know a way to get around or do this differently.

 

Any help would be greatly appreciated.

 

Thanks,

Alan

 

import com.greensock.*;
import com.greensock.easing.*;

var mcArray:Array = [mc01,mc02,mc03,mc04,mc05,mc06,mc07,mc08,mc09];
var tl:TimelineMax = new TimelineMax({delay:2, repeat:-1, repeatDelay:2});

tl.insertMultiple(TweenMax.allTo(mcArray, 1, {y:120, ease:Bounce.easeOut}, 0.2));
tl.insertMultiple(TweenMax.allTo(mcArray, 1, {y:242, ease:Bounce.easeOut}, 0.2), 0.3); 

Link to comment
Share on other sites

Hi,

 

I don't understand the effect you are trying to achieve.

None of the tweens in the first allTo() have any opportunity to complete as your second allTo() starts .3 seconds after the first group of tweens starts. All the tweens in the first group are virtually being overwritten instantly.

 

Your first allTo() says take all 9 mcs, tween them for 1 second to a y value of 120. Make sure each tween starts .2 seconds after the previous tween starts. Also, use a Bounce.easeOut.

.3 seconds later your second allTo() is telling Flash, "oh forget what I said previously, start over and tween everything to a y of 242.

 

Did you mean to use appendMultiple on second group instead so that the second allTo() would run after the items all bounce to 120?

 

tl.insertMultiple(TweenMax.allTo(mcArray, 1, {y:120, ease:Bounce.easeOut}, 0.2));
tl.appendMultiple(TweenMax.allTo(mcArray, 1, {y:242, ease:Bounce.easeOut}, 0.5), 0.3);

 

regardless of the intent of the effect you are going for. adding overwrite:false to the second group will make the timeline play the same way each time it repeats. try:

 

 

tl.insertMultiple(TweenMax.allTo(mcArray, 1, {y:120, ease:Bounce.easeOut}, 0.2));
tl.insertMultiple(TweenMax.allTo(mcArray, 1, {y:242, ease:Bounce.easeOut, overwrite:false}, 0.2), 0.3); 

 

But you could get really the same effect by just removing the first allTo() altogether as it really doesn't serve a purpose that I can see (due to it being overwritten immediately as noted previously)

 

hope this helps. If you have more questions just let me know.

Link to comment
Share on other sites

Thanks Carl, that did the trick. The effect is like a mexican wave type motion through a straight row of movieclips, so the offset is intentional to achieve this. You probably have to see it setup in flash to know what I mean.

 

By the way, I really like your tutorials. Keep up the great work.

 

Thanks again,

Alan

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