# Enable and disable buttons

**URL:** <https://forum.kirupa.com/t/enable-and-disable-buttons/176038>\
**Category:** Uncategorized\
**Created:** [January 19, 2006, 8:31pm UTC](https://forum.kirupa.com/t/enable-and-disable-buttons/176038 "2006-01-19T20:31:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bennymartensson](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bennymartensson/32/1317_2.png) [@bennymartensson](https://forum.kirupa.com/u/bennymartensson)\
**Post date:** [January 19, 2006, 8:31pm UTC](https://forum.kirupa.com/t/enable-and-disable-buttons/176038/1 "2006-01-19T20:31:59Z")

</div>

This is the situation; I have a meny here with 5 buttons. They are called “undermeny1.btn1”, “undermeny1.btn2” etc. What I need to add to this code is that when I click Button 1, this button gets disabled, and if I then click lets say Button 4, Button 1 gets enabled and Button 4 disabled. Maybe an easy one but I just cant think straight. Someone please help.

Here’s the code for my buttons (“undermeny1” is the mc in which the buttons live);

for(var i=1;i\<=8;i++){  
var meny = undermeny1;  
\_root[“meny”][“btn”+i].ivar=i;  
\_root[“meny”][“btn”+i].onRollOver = over;  
\_root[“meny”][“btn”+i].onRollOut = out;  
\_root[“meny”][“btn”+i].onRelease = function(){  
\_level0.myMCL.loadClip (“content/gregory/sub”+this.ivar+".swf", 10);  
}  
}
