Jump to content


[SOLVED] Timeline gotoAndStop + label

Recommended Posts

I have a Timeline with some steps. In the end I want it to go back to the first label and then continue through the other steps.

But when I gotoAndStop("START") and then try to restart the timeline the next animation is wrong,


Kinda hard to explain, but I have attached a zip that I think shows the "error" well.

Link to comment
Share on other sites

hey torben,


could not open the file. perhaps it is CS5, if you save out as CS4 I will take a look.





Link to comment
Share on other sites

Thanks Carl, sorry for the late reply but forgot to subscribe to the thread.

Link to comment
Share on other sites

hmmm.. this is a real brain mangler.


I changed the reset and goto functions to trace out the timeline's currentTime


when reset is called it accurately traces out a currentLabel of "START" and a currentTime of 0.


BUT then when goto is called it thinks currentLabel is backstage and currentTime is 1.2 ???? :roll:


thanks for having those other traces in there. i don't know why this is happening.

everything you have going on in the reset function doesn't seem to be affecting the final delayed goto() call.


very strange.


function reset() : void {
timeline.currentProgress = 0;
trace("reset label = " + timeline.currentLabel + "  time = " +  timeline.currentTime);


function goto(label : String) : void {

timeline.tweenFromTo(timeline.currentLabel, label);
trace(timeline.currentLabel + " to " + label + " time " + timeline.currentTime);


it actually appears to very momentarily try to play START to middlestage but then it freaks out and does a backstage to middlestage.


I wish I had an answer.



Link to comment
Share on other sites

2 seconds later... lol...



try this. instead of having your onComplete:reset on the last tween put it on the timeline like this:


var timeline = new TimelineMax({onComplete:reset});


this seems to make things work as expected.


i'm still confused though.

Link to comment
Share on other sites

First of all, thank you VERY much for posting a sample FLA that demonstrated the issue. I can't tell you how much quicker it made troubleshooting. I wish everyone followed your lead in that respect :)


The problem had to do with the fact that you were resetting the timeline from within a nested tween. I could bore you with a long explanation as to why that's a challenge to deal with, or I could just tell you it should be fixed in the latest version (posted a few minutes ago). I'll opt for the latter if that's okay with you. If you want a deeper explanation, though, just ask.


Link to comment
Share on other sites

Fantastic support!.....thank you Carl for your perseverance and actually finding a solution. Good to know it wasn't me being stupid.


And thank you Jack for fixing it so quickly. You're the best....and no explanation needed :)

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.