Jump to content
Search Community

Still trying to get this clock to work

darngooddesign test
Moderator Tag

Recommended Posts

I'm trying it with TimelineMax. First tween hides all the digits and the rest should toggle them for .1 and leaves them visible for .5 before toggle them off again (.1 sec)..

 

var myTimeline:TimelineMax = new TimelineMax();
myTimeline.insertMultiple([
		new TweenMax([clock0A, clock1A, clock2A, clock3A, clock4A, clock5A, clock6A, clock7A, clock8A, clock9A, clock0B, clock1B, clock2B, clock3B, clock4B, clock5B, clock6B, clock7B, clock8B, clock9B, clock0C, clock1C, clock2C, clock3C, clock4C, clock5C, clock6C, clock7C, clock8C, clock9C, clock0D, clock1D, clock2D, clock3D, clock4D, clock5D, clock6D, clock7D, clock8D, clock9D], 0, {alpha:0, visible:false}),
		new TweenMax([clock0A, clock9B], .1, {alpha:1, visible:true}),
		new TweenMax([clock1A, clock0B], .1, {alpha:1, visible:true}),
		new TweenMax([clock1A, clock1B], .1, {alpha:1, visible:true}),
		new TweenMax([clock1A, clock2B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock1B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock2B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock3B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock4B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock5B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock6B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock7B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock8B], .1, {alpha:1, visible:true}),
		new TweenMax([clock0A, clock9B], .1, {alpha:1, visible:true}),
		new TweenMax([clock1A, clock0B], .1, {alpha:1, visible:true})],
		.1,
		TweenAlign.SEQUENCE,
		.5);

Link to comment
Share on other sites

Thats because it is not a constructor, it is a static method. It returns the TweenMax object however so just do:

var myTween:TweenMax = TweenMax.allTo(...);

 

No, TweenMax.allTo() does not return a TweenMax, it returns an Array containing TweenMax instances. So you cannot set the type of your variable to TweenMax. You'd need to do this:

 

var myTweens:Array = TweenMax.allTo(...);
//or if you don't need to keep track of the array, just do:
TweenMax.allTo(...);

Link to comment
Share on other sites

There aren't alignment options in TweenMax.allTo() - only stagger. The timeline classes (TimelineLite and TimelineMax) have insertMultiple() and appendMultiple() with aligment parameters. You can use the stagger property of TweenMax.allTo() like this:

 

TweenMax.allTo([mc1, mc2, mc3], 1, {y:"100"}, 0.2); //offsets each start time by 0.2 seconds

 

Documentation: http://www.greensock.com/as/docs/tween/

Getting started: http://blog.greensock.com/get-started-tweening/

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