# Enabling Buttons True or False Problem

**URL:** <https://forum.kirupa.com/t/enabling-buttons-true-or-false-problem/43398>\
**Category:** Uncategorized\
**Created:** [February 21, 2004, 10:47pm UTC](https://forum.kirupa.com/t/enabling-buttons-true-or-false-problem/43398 "2004-02-21T22:47:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MArll](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@MArll](https://forum.kirupa.com/u/MArll)\
**Post date:** [February 21, 2004, 10:47pm UTC](https://forum.kirupa.com/t/enabling-buttons-true-or-false-problem/43398/1 "2004-02-21T22:47:38Z")

</div>

Hello All,

I will try an dexplain my problem as best I can.

I am used to using mc’s as buttons now and scripting them accordingly.  
E.g.

btn\_1.onPress=function(){  
gotoAndPlay();  
}

Now, I am making a lot of buttons that exist at the same time, so I want the buttons that aren’t curently active to be disabled, so I script like this, FOR EACH BUTTON:

btn\_1.enabled=false;  
btn\_2.enabled-true;  
btn\_3.enabled-true;

etc…

My problem is, I am in situation where I have up to 15 buttons and I find I have to script each one which means I am having to type an enormous amount of code. I simple do not know how to economise my AS. Top that off with the fact that each button must also have a gotoAndStop function added and I am ending up with 300 + lines of code!! Just for the buttons!!

Can someone help me find a way to write a compact script for this situation??

Many thanks

marll
