Jump to content
GreenSock

learner_7n

How to stop the process while moving to another section"

Recommended Posts

Hi,

 

I have the following code on Home Page which contains some tween animations. When I move to About page and immediately come back to Home page again (before all the animations on Home Page done animation), I see some animations are still in the middle of completion. Actually I should see the animation from starting when I go to Home page from any section.

 

var timeline3:TimelineMax = new TimelineMax();
timeline3.append(TweenMax.fromTo(Home_mc, 1, {x:1000, y:0, alpha:.8}, {x:0, y:0, alpha:1, delay:.5, ease:Elastic.easeOut}));

timeline3.append(TweenMax.fromTo(Home_mc.Character_mc, .5, {x:435, y:-600, alpha:.8}, {x:435, y:200, alpha:1, delay:0, ease:Regular.easeOut}));
timeline3.append(TweenMax.fromTo(Home_mc.Birds_mc, .5, {x:660, y:600, alpha:.8}, {x:660, y:200, alpha:1, delay:0, ease:Regular.easeOut}));

 

How to solve this problem?

 

Please help.

Link to comment
Share on other sites

you can set the timeline back to the beginning by using

 

timeline3.gotoAndStop(0);

 

to play from the beginnning

 

timelline3.gotoAndPlay(0)

 

or

 

timeline3.restart();

 

to stop the timeline where it is use

timeline3.pause();

 

please read section called Public Methods in the TimelineMax documentation:

 

http://www.greensock.com/as/docs/tween/ ... neMax.html

Link to comment
Share on other sites

Hi,

 

I tried it. But still the animation won't stop. If I wait for all the animations stop and then clicking on second time, it's okay.

 

Regards.

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