# Loop a tween with actionscript PROBLEM!

**URL:** https://forum.kirupa.com/t/loop-a-tween-with-actionscript-problem/256619
**Category:** Uncategorized
**Created:** [April 4, 2008, 5:22pm UTC](https://forum.kirupa.com/t/loop-a-tween-with-actionscript-problem/256619 "2008-04-04T17:22:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![samuk](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@samuk](https://forum.kirupa.com/u/samuk)
#### Post date: [April 4, 2008, 5:22pm UTC](https://forum.kirupa.com/t/loop-a-tween-with-actionscript-problem/256619/1 "2008-04-04T17:22:03Z")

</div>

Hi, i am trying to move several movieclips so have tried to create a loop that should perfrom a tween on all the objects but it dosent seem to work, my code is,

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
var origYposition:Number = 450;
var duration:Number = 6;
var depth = 0;
var newLocation:Array = ["250","100","280","350","310","220","100","360","140","290"];
function initialisecell() {
 for (i=0; i<32; i++) {
  var cell = this.attachMovie(["cell"+i], ["cell"+i], depth++);
  cell._x = Math.round(Math.random()*980+20);
  cell._y = origYposition;
 }
}
initialisecell();
 for (i=0; i<10; i++) {
  new mx.transitions.Tween(cell*, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation*, duration, true);
 }
 
/*
 new mx.transitions.Tween(cell0, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation[0], duration, true);
 new mx.transitions.Tween(cell1, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation[1], duration, true);
 new mx.transitions.Tween(cell2, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation[2], duration, true);
 new mx.transitions.Tween(cell3, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation[3], duration, true);
 new mx.transitions.Tween(cell4, "_y", mx.transitions.easing.Regular.easeInOut, origYposition, newLocation[4], duration, true);
*/

```

As you can see, the code at the bottom is commented out. This does work but when i try to create a loop for this it wont move any of my movieclips.

PLEASEEEEEEEEEEEEESSSSSSS HHEEEEEEEELLLLLLLLLPPPPPPP!!!
