# URGENT button enabling/disabling thru array?

**URL:** <https://forum.kirupa.com/t/urgent-button-enabling-disabling-thru-array/136955>\
**Category:** Uncategorized\
**Created:** [February 9, 2005, 4:34pm UTC](https://forum.kirupa.com/t/urgent-button-enabling-disabling-thru-array/136955 "2005-02-09T16:34:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![333944](https://avatars.discourse-cdn.com/v4/letter/3/bbe5ce/32.png) [@333944](https://forum.kirupa.com/u/333944)\
**Post date:** [February 9, 2005, 4:34pm UTC](https://forum.kirupa.com/t/urgent-button-enabling-disabling-thru-array/136955/1 "2005-02-09T16:34:23Z")

</div>

I have three buttons on my stage cmdA, cmdB, cmdC. I have set up an array and some functions on the first frame that looks like this:

[COLOR=Magenta]myButtons = new Array();  
myButtons[0] = \_root.cmdA;  
myButtons[1] = \_root.cmdB;  
myButtons[2] = \_root.cmdC;

\_root.cmdA.onRelease = function(){  
this.enabled = false;  
myButtons[1,2].enabled = true;  
mcLine.\_y = 60;  
}

\_root.cmdB.onRelease = function(){  
this.enabled = false;  
myButtons[0,2].enabled = true;  
mcLine.\_y = 90;  
}

\_root.cmdC.onRelease = function(){  
this.enabled = false;  
myButtons[0,1].enabled = true;  
mcLine.\_y = 120;  
}[/COLOR]

When I run the movie the second and third buttons (B,C) work perfecttly fine, but the first one tends to work sparatically and tends to stay disablled for a long period of time… any Ideas???

Ps. I have posted url here -\> [http://www.touchthedesign.com/static/array/](http://www.touchthedesign.com/static/array/)

keep on contact, Romeo
