Jump to content
Search Community

Create an array for a stagger in Flanimate

barrowman 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

til = new TimelineMax({repeat:0, repeatDelay:0.1});
//-----------------------
var GlowingBalls = [root.Lights.GlowBall1, root.Lights.GlowBall2, root.Lights.GlowBall3,
root.Lights.GlowBall4, root.Lights.GlowBall5, root.Lights.GlowBall6, root.Lights.GlowBall7,
root.Lights.GlowBall8, root.Lights.GlowBall9, root.Lights.GlowBall10, root.Lights.GlowBall11,
root.Lights.GlowBall12, root.Lights.GlowBall13, root.Lights.GlowBall14, root.Lights.GlowBall15,
root.Lights.GlowBall16, root.Lights.GlowBall17, root.Lights.GlowBall18, root.Lights.GlowBall19,
root.Lights.GlowBall20];
//-----------------------
til. .staggerTo(GlowingBalls, 0.75, {alpha:0.1, ease:Bounce.easeInOut, overwrite: false, repeat:30, yoyo:true}, 0.12, 0)

 

Is there a way to make this array simpler and more flexible? Right now it works pretty much as it should in the Stagger. But if I needed to add another 40-odd glowing balls for example, it might be a little cumbersome.

 

In the old AS days you could create a [n] type thing, and create an array up to a value you specified, but I'm more than rusty on AS, which translates to pretty much clueless on how to do this in JS for Flanimate to work with Greensock. 

 

Thanks again

 

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