Jump to content
Search Community

trouble with getLabelBefore for back button

bonassus test
Moderator Tag

Recommended Posts

I'm having trouble with getLabelBefore with the way I have this TimeLineMax set up. because im adding the labels before calling the upDateCurrenSection() function, currentLabel and getLabelBefore() are the same. I wish i could pass a label to getLabelBefore(). I don't want to pass a time to getLabelBefore() as it might change. Is there a solution to the other then completely restructuring the code. Thanks!

 

tl = new TimelineMax( {delay:.5,onComplete:tlComplete, onStart:onStart} );


		tl.addLabel("intro_in", tl.duration);
		var introTl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection});
		introTl.appendMultiple(TweenMax.allFrom(
			[
				m.firstScreen,m.math180Logo
			],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4));
		tl.append(introTl);

		tl.appendMultiple(TweenMax.allTo(
		[
			m.firstScreen,m.math180Logo
		],.8, {alpha:0, ease:_model.theEase}, .4));
		//----------------------------------
		tl.addLabel("section0", tl.duration);


		var section0Tl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection});
		section0Tl.appendMultiple(TweenMax.allFrom(
			[
				m.buda,m.topWindow
			],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4));
		tl.append(section0Tl);


		tl.appendMultiple(TweenMax.allTo(
		[
			m.buda,m.topWindow
		],.8, {alpha:0, ease:_model.theEase}, .4));


		tl.addLabel("section1", tl.duration);

		var section1Tl:TimelineMax = new TimelineMax({onStart:upDateCurrenSection});
		section1Tl.appendMultiple(TweenMax.allFrom(
			[
				m.backBtn,m.sliderWindow,m.slider,m.artDrags,m.labelText,m.stepFrame,m.step
			],.8, {transformAroundCenter:{scaleX:0, scaleY:0}, alpha:0, ease:_model.theEase}, .4));
		tl.append(section1Tl);

		tl.appendMultiple(TweenMax.allTo(
			[
				m.sliderWindow,m.slider,m.artDrags
			],.8, {alpha:0, ease:_model.theEase}, .4));

function upDateCurrenSection(){
	trace(tl.currentLabel);
	trace(tl.getLabelBefore());
	}

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