# There has to be an easier way (Scotty?)

First things first, I suk at for loops and duplicateMovieClip, so I am doing this the hard way. I will have 20 to 30 boxes on the stage that I want to start at one point, then tween in to form a box using the tweenClass using _x and _yscale, _alpha, and _x and _y cords.

This is what I have so far but I am starting to think there has to be a better way.

``````
stop();
alphaMe = Math.random()*100;
function tweenBox1(easeMe) {
boxTween = new mx.transitions.Tween(box1, "_x", easeMe, box1._x, 300, 50);
boxTween = new mx.transitions.Tween(box1, "_y", easeMe, box1._y, 300, 50);
boxTween = new mx.transitions.Tween(box1, "_alpha", easeMe, alphaMe, 100, 50);
boxTween = new mx.transitions.Tween(box1, "_xscale", easeMe, box1._xscale, 200, 50);
boxTween = new mx.transitions.Tween(box1, "_yscale", easeMe, box1._yscale, 200, 50);
}
//buttons As
btn1.onRelease = function() {
tweenBox1(mx.transitions.easing.Strong.easeOut);
}

``````

I can always set a var for the end point either in the button or the function, but to do this for 20 to 30 boxes seems retarded. :geek:
Any ideas? Im lost.
Josh
edit: also, when I apply this to two or more boxes, the random._alpha occurs for all the boxes, for example, they all start at 56.68 instead of one starting at 20, the other starting at 50 and so on.