# For in loop question

**URL:** <https://forum.kirupa.com/t/for-in-loop-question/257648>\
**Category:** Uncategorized\
**Created:** [April 15, 2008, 11:54pm UTC](https://forum.kirupa.com/t/for-in-loop-question/257648 "2008-04-15T23:54:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nukegara](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@nukegara](https://forum.kirupa.com/u/nukegara)\
**Post date:** [April 15, 2008, 11:54pm UTC](https://forum.kirupa.com/t/for-in-loop-question/257648/1 "2008-04-15T23:54:08Z")

</div>

Hi, I have a class file that contains a for in loop. basically there are 50 states (movieclips) on the stage and here is what I have:

```auto
public var statesArray:Array = ['alabama_mc', 'alaska_mc', 'arizona_mc', 'arkansas_mc', 'california_mc'];
    private var states:String;
    
    
    public function Delegates() {
        
    //all of the state movieclips need to be alpha 0.
    for ( states in statesArray ) {
          //this[states].property = value;
          this[states]._alpha = 0;
        trace(states);
        trace(statesArray[states]);
         }

```

I don’t think I understand enough about arrays or for in loops to understand why this isn’t working… it traces the array, but not statesArray[states], and it doesn’t change the alpha of anything.

Please help! thanks!
