Jump to content
Search Community

TweenMax.allTo array item instance variable

crooksy88 test
Moderator Tag

Recommended Posts

Hi,

 

I have an array of instances of a class. Each instance contains a public variable, ypos:int.

 

Can I access this variable within an allTo command so each instance would be tweened to it's own ypos value?

 

e.g.

 

TweenMax.allTo(statsArr, 1, {y:"ypos", ease:Strong.easeOut},.1);

 

Thanks,

 

Mark

  • Like 1
Link to comment
Share on other sites

sorry, but no, that won't work. With allTo() / allFrom() the destination values have to be the same for each tween.

 

for what you want to do, a loop would be the solution

 

for (var i:int = 0; i < statsArr.length; i++){
 var curStat:* = statsArr[i]
  TweenLite.to(curStat, 1, {y:curStat.ypos, delay:i*.1})
}

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