Jump to content
GreenSock

X10

TimelineMax not playing tween on repeat

Moderator Tag

Recommended Posts

Hey guys, I'm hoping you can help, I've spent ages trying to figure out what I'm donig wrong but I just cant figure it out.

 

I've attached the FLA so you can see what's going on but, to describe:

 

I have a timeline that plays, in this timeline I want a balloon to go across the screen, while it goes across the screen is should be rotating backwards and forwards (I have acheived this through a TweenMax yoyo).

When the balloon reaches the end of it's tween the rotation should stop and it should hover up and down (again done through TweenMax yoyo).

After some other tweens happen the balloon should then shoot vertically off stage.

Some more tweens happen and then the timeline repeats.

 

When the timeline repeats, I want that all to start again, however, there are 2 issues:

1) The initial rotation of the balloon I set up does not happen on repeat;

2) The vertical shooting up does not happen, although if I attach an onComplete to this tween this function works.

 

I'm going a bit loopy trying to figure out what I'm doing wrong so any assistance is appreciated.

 

X10

Link to comment
Share on other sites

on easy thing to fix is

 

onStart only happens when the timeline starts inititally... it only fires once.

if you want to call a function every time the timeline repeats use onRepeat also

 

var tl1:TimelineMax = new TimelineMax({timeScale:1,repeat:-1,repeatDelay:4,onStart:TL2Start, onRepeat:TL2Start});

 

That being said, I would discourage you not to use the method of having a timeline that has tweens that control the balloon and then have those tweens fire events that cause other tweens outside of the timeline to control the balloon.

 

what happens is the properties that are set by the "external" tweens do not update the recorded values in the TimelineMax and you could have all sorts of conflicts (which you do).

 

----

 

although a little more complicated than just appending a series of tweens I would suggest that you:

create the balloon sequence in 1 timeline and get the timing as perfect as can be.

create the logo and header animation in another timeline

 

insert both these timelines into a parent timeline, shift the start times as necessary, and then tell the parent timeline to repeat.

Link to comment
Share on other sites

Hi Carl,

Thanks for your response.

I realised the onStart and onRepeat issue a little after I posted!

 

It would be good to know the technicalities of what exactly is going on with the values of the tweens such that the balloon y tween does not happen on the repeat.

 

I will try as you suggest and have the balloon being tweened in it's own timeline and see how I get on.

It just seems like a long way round of doing such a simple thing.

 

X10

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