# Tween class loop?

**URL:** <https://forum.kirupa.com/t/tween-class-loop/198283>\
**Category:** Uncategorized\
**Created:** [August 23, 2006, 7:11pm UTC](https://forum.kirupa.com/t/tween-class-loop/198283 "2006-08-23T19:11:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robinkmedia](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@robinkmedia](https://forum.kirupa.com/u/robinkmedia)\
**Post date:** [August 23, 2006, 7:11pm UTC](https://forum.kirupa.com/t/tween-class-loop/198283/1 "2006-08-23T19:11:55Z")

</div>

I have a function that’s called onPress, that sends boxes to a specific location.  
I’m using tween class- anyway what is the ideal way to truncate this code?  
Could I use a loop and just replace the numbers (1, 2, 3) with “i”?  
If so could someone show m an example?  
Thanks in advance!

function mover (box1X, box1Y, box2X, box2Y, box3X, box3Y) {  
box1rotateMe.continueTo (0, tweenSpeed);  
box1scaleMeX.continueTo (100, tweenSpeed);  
box1scaleMeY.continueTo (100, tweenSpeed);  
box1locationX.continueTo (box1X, tweenSpeed);  
box1locationY.continueTo (box1Y, tweenSpeed);  
//  
box2rotateMe.continueTo (0, tweenSpeed);  
box2scaleMeX.continueTo (100, tweenSpeed);  
box2scaleMeY.continueTo (100, tweenSpeed);  
box2locationX.continueTo (box2X, tweenSpeed);  
box2locationY.continueTo (box2Y, tweenSpeed);  
//  
box3rotateMe.continueTo (0, tweenSpeed);  
box3scaleMeX.continueTo (100, tweenSpeed);  
box3scaleMeY.continueTo (100, tweenSpeed);  
box3locationX.continueTo (box3X, tweenSpeed);  
box3locationY.continueTo (box3Y, tweenSpeed);  
}
