Jump to content

Matt Severin

Animate CC, animate multiple instances with a for loop

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

I can't seem to find anything for this online.

I want to run a tween on multiple instances named with a number convention, like so (I'm using a syntax that I remember from the as2 days) -

for(var i = 0; i < 40; i++){
    t.from(this.["myInstance"+i], 1, {scaleX:0, delay:i});

But I don't know how to replace this.["myInstance"+i] with the proper canvas syntax.

Link to comment
Share on other sites

Ha, totally, and that is exactly the same as as2. Thanks for being a set of eyes.

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.