# Tweening 6 Different Objects

**URL:** <https://forum.kirupa.com/t/tweening-6-different-objects/219910>\
**Category:** flash\
**Created:** [March 21, 2007, 2:20am UTC](https://forum.kirupa.com/t/tweening-6-different-objects/219910 "2007-03-21T02:20:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [March 21, 2007, 2:20am UTC](https://forum.kirupa.com/t/tweening-6-different-objects/219910/1 "2007-03-21T02:20:07Z")

</div>

Is there an easier way to set up 6 different similar tweens? I can’t seem to get a “for” loop to work - my lack of sleep isn’t helping either 🙂 Each of the nested clips is sitting on the main stage. The following code works, but it’s way too long:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;  
//  
var next1Alpha:Object = new Tween(panel1.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next1Alpha.onMotionFinished = function() {  
this.yoyo();  
};  
var next2Alpha:Object = new Tween(panel2.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next2Alpha.onMotionFinished = function() {  
this.yoyo();  
};  
var next3Alpha:Object = new Tween(panel3.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next3Alpha.onMotionFinished = function() {  
this.yoyo();  
};  
var next4Alpha:Object = new Tween(panel4.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next4Alpha.onMotionFinished = function() {  
this.yoyo();  
};  
var next5Alpha:Object = new Tween(panel5.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next5Alpha.onMotionFinished = function() {  
this.yoyo();  
};  
var next6Alpha:Object = new Tween(panel6.next\_mc, “\_alpha”, Regular.easeOut, 100, 40, 0.75, true);  
next6Alpha.onMotionFinished = function() {  
this.yoyo();  
};
