Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Matthew Severin

Animate CC, animate multiple instances with a for loop

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

That dot is a bug there

 

this[ "myInstance" + i ]

 

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