Jump to content
Search Community

adding tweens to TimelineMax

FlashDev2007 test
Moderator Tag

Recommended Posts

Hello Jack,

 

Firstly I have watched the video on using TimelineMax so I understand how it works, but I cannot get my head around how to stop my tweens from running before I add them.

 

What I am trying to do is create the TimelineMax in a class of its own and I have methods to add tweens to it in that class. The tweens are created in other views and they call this class to add them. The problem is, when I create a tween in a view, it just sets of tweening. I tried to pause it before the timeline gets it but then it don't play at all. I also set paused:true in the timeline constructor.

 

Is it possible to create the tweens elsewhere in my application, add them when I want and then set the whole thing off later using timeline.play(); ?

 

Hope you can help me with this one.

 

Many thanks and great work.

 

Neil

Link to comment
Share on other sites

Sure. Think of a TimelineMax as a MovieClip timeline in the Flash IDE, so if you pause or stop() the timeline, none of the tweens play either because the playhead isn't moving. You do NOT need to pause each and every tween individually. All you'd need to do is:

 

var timeline:TimelineMax = new TimelineMax({paused:true});
timeline.append(...);
//add whatever tweens you need here...

//then whenever you want to start playing, just do:
timeline.play();

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