# Disable button within an array

**URL:** <https://forum.kirupa.com/t/disable-button-within-an-array/179363>\
**Category:** flash\
**Created:** [February 19, 2006, 11:33am UTC](https://forum.kirupa.com/t/disable-button-within-an-array/179363 "2006-02-19T11:33:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashwillkill](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@flashwillkill](https://forum.kirupa.com/u/flashwillkill)\
**Post date:** [February 19, 2006, 11:33am UTC](https://forum.kirupa.com/t/disable-button-within-an-array/179363/1 "2006-02-19T11:33:08Z")

</div>

Hi Kirupians,  
For some reason my buttons do not want to be disabled??  
And I am getting blind from looking at it and finding the problem.  
Anyone has some insight?  
Thanks in advance

```auto
buttsArray = new Array();
buttsArray = ["btn1", "btn2", "btn3", "btn4", "btn5"];
function makeButtons() {
	for (var i = 0; i<buttsArray.length; i++) {
		var btn = galBtnBase.attachMovie("galBtn", "galBtn"+i, i+100);
		btn.id = i;
		btn._x = Math.floor(i)*26;
		
		btn.onRelease = function() {
			trace("btn"+this.id);
			disButtons(this.id);
			container.loadPhoto(pathToPics+"image0"+(this.id)+".jpg");
		};
		btn.onRollOver = btn.onDragOver=function () {
			this.gotoAndStop(2);
		};
		btn.onRollOut = btn.onDragOut=function () {
			this.gotoAndStop(1);
		}
	}

function disButtons(d) {
	for (var i = 0; i<buttsArray.length; i++) {
		if (i != d) {
		this[btn*].enabled = 1;
		this[btn*].gotoAndStop(1);
		} else {
		this[btn*].enabled = 0;
		this[btn*].gotoAndStop(3);
		}
	}
}

}

```
