# Loop and Tween. How can I solve this?

**URL:** <https://forum.kirupa.com/t/loop-and-tween-how-can-i-solve-this/304927>\
**Category:** flash\
**Created:** [February 16, 2010, 5:04pm UTC](https://forum.kirupa.com/t/loop-and-tween-how-can-i-solve-this/304927 "2010-02-16T17:04:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shapper](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@shapper](https://forum.kirupa.com/u/shapper)\
**Post date:** [February 16, 2010, 5:04pm UTC](https://forum.kirupa.com/t/loop-and-tween-how-can-i-solve-this/304927/1 "2010-02-16T17:04:04Z")

</div>

Hello,

I have the following loop:

```auto

  var disabled = new Array('RB0','RC0');
  for (var j = 0; j < disabled.length; j++ ) {
    var d : MovieClip = getChildByName(disabled[j]) as MovieClip;
    var tween:Tween = new Tween(d, "alpha", Strong.easeOut, 1, 0.25, 2, true);
  } // Fade disabled
 

```

In this case I have only two elements in the array but in fact I will have 70.

I get the error on tween:  
Warning: 3596: Duplicate variable definition.

I understand why but how can I avoid this?

I mean, I want only to apply the tween not store it in a tween variable.

I am not sure the best way to tween the 2 … 70 Movie Clips.

How should I do this?

Thank You,  
Miguel
