Creating Tweens in a loop

Hi All,

I’m stuck on trying to create a bunch of motion tweens in a loop
(to create an infinitely scrolling puzzle):

I know the ‘var’ part of this doesnt work…

for (x=1; x<20; x++) {
  var ["myTween"+x]:Object = 
     new Tween(["myMC"+x], "_y",   start, end, duration, true);
}


so I tried to put the tweens in an array:


hitTween = new Array();
for (x=1; x<20; x++) {
  myTween[x] = new Tween(["myMC"+x], "_y",   start, end, duration, true);
  hitTween[x].onMotionFinished =
  function() {trace("here we go again");};
}


But that doesn’t seem right either, the tweens don’t start visually in this case. However, the onMotionFinished function does get triggered.

I’d appreciate any pointers in the right direction, thank you!

Thanks for reading my 1st post!

Cheers,
Hofuzz