# Coded button states mx

**URL:** https://forum.kirupa.com/t/coded-button-states-mx/100228
**Category:** Uncategorized
**Created:** [January 27, 2004, 3:22am UTC](https://forum.kirupa.com/t/coded-button-states-mx/100228 "2004-01-27T03:22:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Gregory](https://avatars.discourse-cdn.com/v4/letter/g/e56c9b/32.png) [@Gregory](https://forum.kirupa.com/u/Gregory)
#### Post date: [January 27, 2004, 3:22am UTC](https://forum.kirupa.com/t/coded-button-states-mx/100228/1 "2004-01-27T03:22:08Z")

</div>

Hi,  
I am trying to complete my navigation bar. I have the onRollOver / Out and Release states finished, my only problem now is that onRelease is not reversable. Once I click on another button, my previously pressed button is still in its down state. All my buttons have been created dynamically with no timelines involved. He is the button code that is within a for loop:

```auto

navBar["myBtn"+i].onRollOver = function() {
			//create pointer mc over button
			var pointer = this.attachMovie("buttonPointer", "pointer_mc", 21);
			with (pointer) {
				_x = this._width/2 -3;
				_y = -2;
				_alpha = 0;
			}
			this.onEnterFrame = function() {
				if (this.pointer_mc._y&lt;3) {
					this.pointer_mc._y += 1;
					this.pointer_mc._alpha += 20;
				}
			};
			this.name_txt.textColor = 0xFFF0FF;
		};
		navBar["myBtn"+i].onRollOut = function() {
			this.onEnterFrame = function() {
				this.pointer_mc._y -= 1;
			};
			this.name_txt.textColor = 0x000000;
		};
		navBar["myBtn"+i].onRelease = function() {
			this.name_txt.textColor = 0xFFFFFF;
			this.enabled = false;
		}

My question then, is how do you have your button return to its orginal state after another one is clicked.

Oh, i nearly forgot, is it possible too, to create an onRelease action seperate to the one in the above code (as long as i reference right) so that i can loadMovie etc.

cheers
Greg:huh: :huh:
```
