Jump to content
Search Community

Tweening and callback order [SOLVED]

partap test
Moderator Tag

Recommended Posts

I'm trying to set up a timeline that displays a countdown: "READY", "SET", "GO", where each word shrinks and fades in. I think I've got the code right, but it only seems to work some of the time, other times the label text will update, but it doesn't shrink or fade...I think it might have to do with the tweens or callbacks interfering with each other if the machine is too slow but I'm not sure...

 

Can you tell me if this code looks right? If so, what can I do to fix it?

		var tl:TimelineLite = new TimelineLite();
		tl.append(new TweenLite(m_notice, 0, {alpha:0, scaleX:2,scaleY:2,
			onComplete:setNotice, onCompleteParams:['READY'],
			immediateRender:true, overwrite:0}));
		tl.append(new TweenLite(m_notice, 1, {alpha:1, scaleX:1, scaleY:1,overwrite:0}));
		tl.append(new TweenLite(m_notice, 0, {alpha:0, scaleX:2, scaleY:2,
			onComplete:setNotice, onCompleteParams:['SET'],
			immediateRender:false,overwrite:0}));
		tl.append(new TweenLite(m_notice, 1, {alpha:1, scaleX:1, scaleY:1,overwrite:0}));
		tl.append(new TweenLite(m_notice, 0, {alpha:0, scaleX:2, scaleY:2,
			onComplete:setNotice, onCompleteParams:['GO'],
			immediateRender:false,overwrite:0}));
		tl.append(new TweenLite(m_notice, 1, {alpha:1, scaleX:1, scaleY:1,overwrite:0}));
		tl.append(new TweenLite(m_notice, 0.5, {autoAlpha: 0,
			immediateRender:false,overwrite:0}));
		m_timeline.insert(tl, 1);

Link to comment
Share on other sites

Hmm. If I remove all of the immediateRender and overwrite params, the only label I see is "GO".

With the immediateRender params reapplied to the zero-duration tweens, all I get is "READY"

With the overwrite params reapplied, I'm back to where I was at the start: "READY" fades and scales properly, and it always properly updates the text to "SET" and "GO", but the fade and scale tweens for those labels only work sporadically...

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