Jump to content
Search Community

Declaring TweenMax Objects and use them later

MultipleParadox test
Moderator Tag

Recommended Posts

Hi,

 

I've been looking for this for hours and I'm starting it's not even possible to do.

 

Is there any ways so we can declare different TweenMax Objects, without having them to start tweening anything, and then use them anytime we like? I'm not looking for a mere "pause it after creation" solution, although it could be a workaround.

 

What I'm aiming for exactly is something like this:

 

documentClass:

 

constructor()

{ var mainTimeline:TimelineLite = new TimelineLite();

var anim1:TimelineLite = setupAnim1();

var anim2:TimelineLite = setupAnim2();

 

//Have some listener then have " mainTimeline.play(); "

}

 

function setupAnim1():TimelineLite

{ var tm1:TweenMax = new TweenMax(mc, 1, {startAt:{y: -20}});

var tm2:TweenMax = new TweenMax(mc, 1, {startAt:{alpha:0 }); // startAt to simulate "TweenMax.from"

var tlm= new TimelineLite();

tlm.append(tm1);

tlm.append(tm2);

return tlm;

}

 

function setupAnim2():TimelineLite

{ // similar to setupAnim1()

}

 

___

 

 

I don't want ANYTHING to happen until I call the play() method of the timelineLite object. Is that even possible or am I missing something big here?

 

Apparently the startAt property will have the object's said property take that value at the moment the TweenMax object is declared. I trie playing with "immediateRender" and such but it did no good

 

Any help would be appreciated

 

thank you

 

O.

Link to comment
Share on other sites

sure...

constructor()
{ 

var mainTimeline:TimelineLite = new TimelineLite();
mainTimeline.pause();

var anim1:TimelineLite = setupAnim1();
var anim2:TimelineLite = setupAnim2();

}

 

I'd really recommend reading through the ASDOC's as you actually have an incredible amount of control over the progress of a timeline. You can even use TweenLite, TweenMax to tween a timeline's overall progress (thereby easing the progress among other cool things).

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