Jump to content
Search Community

Animate CC - Staggering an array of displayObject (solved)

absolutGob test
Moderator Tag

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 guys,

 

I 'm using Animate CC 2017 and i would like to animate one by one childs of a clip, which can be letters for example.

 

I've tried using something like this :

 

tl.staggerFrom(this.myClip.children, 0.6, {x:"-=50", alpha:0}, 0.03, "-=0.8");


but it doesn't works.

 

Does someone using animate CC 2017 know if such a thing is possible ?

 

Thanks for your help. Sorry for my english, it's not my native language.

Link to comment
Share on other sites

I don't have access to Animate at the moment (machine rebuild) but I remember some issues with addChild and child-related methods on the first frame of the timeline. Just as a test make sure this.myClip.children is something an not undefined. Try adding the following line immediately before the animation code:

 

console.log(this.myClip.children)

 

if you get "undefined" try moving your code to the next frame.

 

  • Like 1
Link to comment
Share on other sites

Thanks Carl for loonking at my problem.

 

This is what i get as you can see in the attached file :

Array(5)
	>0: lib.Symbole4
	>1: lib.Symbole5
	>2: lib.Symbole6
	>3: lib.Symbole7
	>4: lib.Symbole8
	length: 5
	>__proto__: Array(0)

 

It's not an error. It's just like it didn't take in count the array.

The other part of the code works perfectly and when i put manually all the elements it works :

 

tl.staggerFrom([this.retex.p1, this.retex.p2, this.retex.p3, this.retex.p4, this.retex.p5], 1, {scaleX:5, scaleY:5, alpha:0, ease:Bounce.easeOut}, 0.1, "intro")

 

But i've some parents clip with more than 25 elements and can't put them all manually (it's just letters for example).

 

If we can't use animation and stagger on array with animate CC, i serously doubt why should i continue to use it for HTML5 canvas. 

Capture.JPG

Link to comment
Share on other sites

this is quite strange and looks like a bug in Animate.

 

If you force your clip to gotoAndStop(0) before the stagger or place your code on frame 2 in the timeline it works.

 

With a single frame I did:

console.log(this.boxes.children);
this.boxes.alpha = 0.5;
this.boxes.gotoAndStop(0)
TweenMax.staggerTo(this.boxes.children, 1, {scaleX:2, scaleY:3}, 0.5);
//this.boxes.box1.scaleX = 4
this.stop();

 

attached is my fla

animate-stagger.fla.zip

  • Like 2
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...