Jump to content
Search Community

staggerTo within Animate CC

vanwoods test
Moderator Tag

Go to solution Solved by Oliver16Years,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi, 

 

I'm trying to figure out why my stagger isn't working in Animate CC.

 

.staggerTo is possible from within Animate CC is it?!

var root = this, tl;

tl = new TimelineMax();
tl.staggerTo([root.headline, root.tagline, root.logo, root.cta], 1, {alpha: 1, ease: Back.easeOut});

Tried it with all the elements have the same instance name, but that doesn't work also. 

 

Somebody knows if there is an overview what can and can't be used from GSAP within Animate CC?

 

Thanks in advance!

 

Regards, 

 

vanWoods

Link to comment
Share on other sites

  • Solution

I think the stagger argument is missing from Your code:
 

TweenMax.staggerTo( targets:Array, duration:Number, vars:Object, stagger:Number, onCompleteAll:Function, onCompleteAllParams:Array, onCompleteAllScope:* ) : Array

https://greensock.com/docs/#/HTML5/Animation/TweenMax/staggerTo/
 

Try something like this:

tl.staggerTo([root.headline, root.tagline, root.logo, root.cta], 1, {alpha: 1, ease: Back.easeOut}, 0.1 );
  • Like 2
Link to comment
Share on other sites

Thanks Oliver16Years

 

It seems to work now, by adding the stagger number. 

 

Does Animate CC accepts one instance name for multiple objects? Makes it easier to target multiple elements. Just like adding one class for multiple elements in a DOM environment?

 

Like this:

tl = new TimelineMax();
tl.staggerTo([root.elements], 1, {alpha: 1, ease: Back.easeOut}, .2 );

It now only triggers the element on the top layer. 

Link to comment
Share on other sites

I would try to address container.children as can be seen in the EaselJS documentation:

http://www.createjs.com/docs/easeljs/classes/Container.html#property_children

 

"children Array

Defined in children:62
The array of children in the display list. You should usually use the child management methods such as addChild, removeChild, swapChildren, etc, rather than accessing this directly, but it is included for advanced uses.
Default: null"
 

I am guessing now because I don't have Animate.

This lib ( EaselJS ) is part of the open source CreateJS, which is the engine of Animate's HTML export feature under the hood. Worth to glance through the docs for a better understanding of the possibilities.

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