# Inactive buttons

**URL:** <https://forum.kirupa.com/t/inactive-buttons/11925>\
**Category:** flash\
**Created:** [January 24, 2003, 12:38am UTC](https://forum.kirupa.com/t/inactive-buttons/11925 "2003-01-24T00:38:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![soulty](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/soulty/32/105_2.png) [@soulty](https://forum.kirupa.com/u/soulty)\
**Post date:** [January 24, 2003, 12:38am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/1 "2003-01-24T00:38:30Z")

</div>

hey sorry to be repeating a thread, i just cant find where the thread is of how to make a button inactive.

What i want to do, is when a external movie is loaded i want its button which is on the main timeline to become inactive , maybe greyed out or have a constant mouse over.

Any help will be appreciated.

thanx 😏

---

<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:** [January 24, 2003, 12:47am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/2 "2003-01-24T00:47:57Z")

</div>

try this code:

button.enabled = false;

---

<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:** [January 24, 2003, 12:50am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/3 "2003-01-24T00:50:45Z")

</div>

thanxs Guig0, i found the thread i was looking for though, but that was part of what i wanted.

thanx

---

<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:** [January 24, 2003, 12:54am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/4 "2003-01-24T00:54:13Z")

</div>

anytime! =)

---

<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:** [January 24, 2003, 6:43am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/5 "2003-01-24T06:43:10Z")

</div>

ok kool, turned the button off, all is good, but if i was to want the button that was just pressed to be able to show that it is in that buttons section. like have it on its over state constantly till another section ( button) is pressed.

---

<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:** [January 24, 2003, 8:08am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/6 "2003-01-24T08:08:54Z")

</div>

Wow… I am sure there is an easier way with actionscript, but it isn’t coming to me.

(This is going by using movie clips as buttons in MX)  
What you can do though is set a variable… something like…

homeButtonActive = true

Then you can set an if statement checking if it is true.

```auto
onClipEvent(enterFrame){
if (homeButtonActive == true){
this.onPress = function(){
 this.gotoAndStop(2);
 this.enabled = false;
}
} else (
 this.gotoAndStop(1);
 this.enabled = true;
}
}

```

What this says that if the homeButtonActive variable equals true then when the button is pressed it will gotoAndStop on the 2nd frame of the button MC (in which the over state of your clip will be) and if the homeButonActive equals false, then it will go back to frame 1 and re enable the button.

Make any sense?

edit: oh yeah… your button mc will have 2 frames… 1 regular and 1 over. Each frame should have a stop() action on it.

---

<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:** [January 24, 2003, 8:17am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/7 "2003-01-24T08:17:17Z")

</div>

what if you were to use buttons that had , over and out actions on it, such as a arrow tween in on mouse over and arrow tween out on mouse out, and what i wanted to keep there as indication to the area currently in a red arrow which is static.

can the same code be used?

---

<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:** [January 24, 2003, 8:19am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/8 "2003-01-24T08:19:54Z")

</div>

Well the code given was just a method. It was meant to show you how a variable could be implemented into a situation like that.

You can chage the gotoAndPlays and gotoAndStops to whatever you want.

And on MCs in Flash MX you can use on handlers so you can do the on (rollOver) on an MC like you can on a button.

---

<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:** [January 24, 2003, 8:23am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/9 "2003-01-24T08:23:20Z")

</div>

ok kool, thanks lost ill give it a go.

---

<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:** [January 24, 2003, 8:26am UTC](https://forum.kirupa.com/t/inactive-buttons/11925/10 "2003-01-24T08:26:21Z")

</div>

I wish you luck.

It is 3:30am here now… I am very tired…lol.

I bid you farewell 🙂
