# \[i\]?

**URL:** <https://forum.kirupa.com/t/i/176623>\
**Category:** flash\
**Created:** [January 25, 2006, 5:12pm UTC](https://forum.kirupa.com/t/i/176623 "2006-01-25T17:12:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewi\_p](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@lewi\_p](https://forum.kirupa.com/u/lewi_p)\
**Post date:** [January 25, 2006, 5:12pm UTC](https://forum.kirupa.com/t/i/176623/1 "2006-01-25T17:12:16Z")

</div>

I have a piece of code that uses AS to tween movieclips around the stage…see below:

```auto
 
tweenspeed = 50;
mc1 = _root[trans];
y1 = _root[trans]._y;
x1 = _root[trans]._x;
go_y1 = _root.point1._y;
go_x1 = _root.point1._x;
Tween_y1 = new mx.transitions.Tween(mc1, "_y", easeType, y1, go_y1, tweenspeed);
Tween_x1 = new mx.transitions.Tween(mc1, "_x", easeType, x1, go_x1, tweenspeed);

```

If I have 20 ball mc’s each called ball1, ball2, ball3 etc…I would need to run this script through a loop adding 1 the end of ball each time the loop runs.  
I think I’ve made it ok but it doesnt work…could someone check through the 2nd bit of code and tell me what I’m doin wrong…its most likey to do with the \* bits.

Anyway here it is…

function ballTween() {  
tweenspeed = 50;  
trans = [];  
mc = [];  
y = [];  
x = [];  
go\_y = [];  
go\_x = [];  
Tween\_y = [];  
Tween\_x = [];  
ball = [];  
point = [];  
for (i=1; i\<51; i++) {  
trans\* = shortList.search(team\*);  
mc\* = \_root[trans+i];  
y\* = \_root[trans+i].\_y;  
x\* = \_root[trans+i].\_x;  
go\_y\* = \_root.point\*.\_y;  
go\_x\* = \_root.point\*.\_x;  
Tween\_y\* = new mx.transitions.Tween(mc\*, “\_y”, easeType, y\*, go\_y\*, tweenspeed);  
Tween\_x\* = new mx.transitions.Tween(mc\*, “\_x”, easeType, x\*, go\_x\*, tweenspeed);  
}  
}
