# Simple for loop + array to disable a group of buttons

**URL:** <https://forum.kirupa.com/t/simple-for-loop-array-to-disable-a-group-of-buttons/223116>\
**Category:** Uncategorized\
**Created:** [April 19, 2007, 5:27pm UTC](https://forum.kirupa.com/t/simple-for-loop-array-to-disable-a-group-of-buttons/223116 "2007-04-19T17:27:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [April 19, 2007, 5:27pm UTC](https://forum.kirupa.com/t/simple-for-loop-array-to-disable-a-group-of-buttons/223116/1 "2007-04-19T17:27:09Z")

</div>

What’s wrong with this code:

```auto
var btnNames:Array = ["gertrude_0", "gertrude_1", "gertrude_2", "btnPrev", "btnStop", "btnPlay", "btnNext", "prevSec", "nextSec"];

for(i=0; i< btnNames.length; i++){
    btnNames*.ivar = i;
    btnNames*.enabled = false;
}

```

after viewing some good posts at [1, [URL=“http://www.kirupa.com/forum/showthread.php?t=235620”]2, and [URL=“http://www.kirupa.com/forum/showthread.php?t=228363”]3](http://www.kirupa.com/forum/showthread.php?t=256083), I tried to apply what I learned but it did not work.

It was originally

```auto
for(i=0; i< btnNames.length; i++){    
    this.btnNames*.enabled = false;
}

```
