I have the following code
[AS]si = setInterval(function () {
ind++;
ind>7 ? clearInterval(si) : null;
var tw = new Tween(_root._mc[“a”+ind], “_xscale”, Regular.easeOut, 0, 200, 60);
new Tween(_root._mc[“a”+ind], “_yscale”, Regular.easeOut, 0, 200, 60);
tw.onMotionFinished = function() {
new Tween(_root._mc[“a”+ind], “_xscale”, Regular.easeIn, 0, 100, 40);
new Tween(_root._mc[“a”+ind], “_yscale”, Regular.easeIn, 0, 100, 40);
};
}, 50);
[/AS]Basically, it goes through 7 loops and animates each object. My problem is that the onMotionFinished function isnt being triggered because it gets overwritten each time before it can. is there a way to dynamically create a variable name to keep track of each Tween? Something like [AS]var eval(“tw” + ind) = new Tween(_root._mc[“a”+ind], “_xscale”, Regular.easeOut, 0, 200, 60);
eval(“tw” + ind).onMotionFinished = function() {[/AS]except eval appears to only work for objects. Any ideas?