# \[MX\] loop function problem

**URL:** <https://forum.kirupa.com/t/mx-loop-function-problem/54480>\
**Category:** flash\
**Created:** [June 15, 2004, 2:27am UTC](https://forum.kirupa.com/t/mx-loop-function-problem/54480 "2004-06-15T02:27:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Bastos](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@Felipe\_Bastos](https://forum.kirupa.com/u/Felipe_Bastos)\
**Post date:** [June 15, 2004, 2:27am UTC](https://forum.kirupa.com/t/mx-loop-function-problem/54480/1 "2004-06-15T02:27:50Z")

</div>

Hi. I have a function that loops inside a movieclip with 7 btns that tells what collor the last hit btn should be and what collor the rest should look like. The problem is that after I hit one btn, I cant make the object btn function as a btn, with the rollover and others btn frame properties.  
Here is the function:

```auto
// define a funcao mA2click (menu A)
function mA1click() {
	for (var a=1; a<8; a++) {
		var btn = _root.mA1["A1"+a];
		if (btn == this) {
			hitColor = new Color(this);
			hitColor.setRGB(0xff0000);
			clickSound = new Sound(btn);
			clickSound.attachSound("click");
			clickSound.start(0, 3);
			this.enabled = false;
		} else {
			normalColor = new Color(_root.mA1["A1"+a]);
			normalColor.setRGB(0x333333);
			_root.mA1["A1"+a].enabled = true;
			_root.mA1["A1"+a].onRollOver = _root.mouseOver(this);
		}
	}
}
	for (var a=1; a<8; a++) {
		_root.mA1["A1"+a].onRelease = mA1click;
	}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2004, 6:23pm UTC](https://forum.kirupa.com/t/mx-loop-function-problem/54480/2 "2004-07-14T18:23:10Z")

</div>

Returning to the function on the top of this page, how can I reset all the buttons to their original color on a release action?
