# AS2 array question

**URL:** <https://forum.kirupa.com/t/as2-array-question/331346>\
**Category:** Uncategorized\
**Created:** [July 11, 2013, 1:46pm UTC](https://forum.kirupa.com/t/as2-array-question/331346 "2013-07-11T13:46:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skarab](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Skarab](https://forum.kirupa.com/u/Skarab)\
**Post date:** [July 11, 2013, 1:46pm UTC](https://forum.kirupa.com/t/as2-array-question/331346/1 "2013-07-11T13:46:21Z")

</div>

I’ve got a bunch of yellow highlights that I need to turn off and on with a button, so I’m using an array, but can’t seem to get it to work. I know it’s mostly right because the initial state, with alpha at 0, works fine, but the “if/else if” statement that turns them on and off isn’t taking. Here’s my code:

```auto
hilites = ["F16", "F17", "F20", "F22", "F23", "F24", "F26", "F27", "F28", "C14", "C15", "C16", "C17", "C18", "C20", "C22", "C23", "C24", "C27", "C29", "C30", "C31", "C32", "C33", "C51", "C57", "W11", "W12", "W13", "W14", "W16", "W21", "W23"]

for(i=0; i<hilites.length; i++){
    var btn:MovieClip = draggable_mc[hilites*+"Hilite_mc"];
    
    btn._alpha = 0;
    
    fricewBtn_mc.onRollOver = function(){
        this.gotoAndStop("over");
        };
    fricewBtn_mc.onPress = function(){
        this.gotoAndStop("down");
        };
    fricewBtn_mc.onRollOut = function(){
        this.gotoAndStop("off");
        };
    fricewBtn_mc.onRelease = function(){
        
        if (btn._alpha == 0)
        {
            btn._alpha = 100;
        }
        else if (btn._alpha == 100)
        
        btn._alpha = 0;
        ;
        this.gotoAndStop("on");
    };
};

```

Any comments welcome!
