Jump to content
Search Community

TimelineMax - jumping back to previous slides

mspanish test
Moderator Tag

Recommended Posts

Hello again - my timeline works great, and the forward navigation works great. But for going back through my 5 slides, I'm having a terrible time with the text refusing to disappear. My previous button's handler look's like this:

 

function prevHandler(event:MouseEvent):void  
{  

switch(timeline.currentLabel)
{

case "page2":
removeChild(string2_txt)
timeline.gotoAndStop("page1")
initSlide1();   		 
timeline.restart();
break;
case "page3":
removeChild(string3_txt)
timeline.gotoAndStop("page2")
initSlide2();
break;
case "page4":
removeChild(string4_txt)
timeline.gotoAndPlay("page3")
initSlide3();
break;
case "page5":
removeChild(string5_txt)
timeline.gotoAndPlay("page4") 
initSlide4();
break;
}  
} 

 

And my timeline looks like this:

timeline.addLabel("page1", timeline.duration)  
timeline.append(TweenMax.from(page1, 4, {autoAlpha:0,  onInit:initSlide1, pause:true} ) ); 
timeline.append(TweenMax.delayedCall(2, initSlide2)); 
timeline.addLabel("page2", timeline.duration)   
timeline.append(TweenMax.from(page2, 4, {x:0, y:0, autoAlpha:0, pause:true})); 
timeline.append(TweenMax.delayedCall(2, initSlide3)); 
timeline.addLabel("page3", timeline.duration) 
timeline.append(TweenMax.from(page3, 4, {x:0, y:0, autoAlpha:0, pause:true})); 
timeline.append(TweenMax.delayedCall(2, initSlide4)); 
timeline.addLabel("page4", timeline.duration)  
timeline.append(TweenMax.from(page4, 4, {x:0, y:0, autoAlpha:0, pause:true})); 
timeline.append(TweenMax.delayedCall(2, initSlide5));
timeline.addLabel("page5", timeline.duration) 
timeline.append(TweenMax.from(page5, 4, {x:0, y:0, autoAlpha:0, onComplete:timeStop})); 

 

Has anybody conquered a similar problem?

 

thanks in advance!

Stacey

Link to comment
Share on other sites

I would suggest integrating the display of your txt with the timeline so that your position in the timeline dictates everything that is visible at a particular point in time.

 

timeline.addLabel("page1", timeline.duration)

timeline.append(TweenMax.from(page1, 4, {autoAlpha:0, onInit:initSlide1, pause:true} ) );

timeline.append(TweenMax.from(string1_txt), 1, {autoAlpha:0}) );

timeline.append(TweenMax.delayedCall(2, initSlide2));

 

 

----

 

also I don't know what initSlide2, 3, 4, 5 do. but I'd be careful with how you use delayed call with such a big delay of 2 seconds.

 

 

what will happen if the timeline plays through to page 3, the delayed call for initSlide4 gets set to run in 2 seconds, but before that time the user navigates back to frame 2?

 

is initSlide4 going to mess things up if runs 2 seconds later while you are on page 2?

 

you may be better off using onStart in the tween that introduces a new page.

 

just something to think about.

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