Jump to content


using variable from array as x or y value

Recommended Posts

Hi there. Can someone demonstrate how I would pass a numerical value to positioning setting such as x or y that is set in a variable from an array using Tweenlite if possible? (tweenmax?)


For example, the Flash tween version:

var myNumber : Number = 0;

var myArray : Array [30, 20, 10];

new Tween(instance_mc,"x",Regular.easeOut,instance_mc.x,myArray[myNumber],1,true);

Thanks for any help! :) 

Link to comment
Share on other sites

Should be as simple as:

TweenLite.to(mc, 1, {x:myArray[myNumber]});

Let us know if you need more help

  • Like 1
Link to comment
Share on other sites

Thanks for confirming - that is straight forward enough. 

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.