# Disabling a button

**URL:** <https://forum.kirupa.com/t/disabling-a-button/19729>\
**Category:** flash\
**Created:** [April 30, 2003, 10:05pm UTC](https://forum.kirupa.com/t/disabling-a-button/19729 "2003-04-30T22:05:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmadbat](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@ahmadbat](https://forum.kirupa.com/u/ahmadbat)\
**Post date:** [April 30, 2003, 10:05pm UTC](https://forum.kirupa.com/t/disabling-a-button/19729/1 "2003-04-30T22:05:32Z")

</div>

I need to know how to disable a button  
i used :  
\_root.(buttonname).enabled=false;  
for buttons which is on the stage directly but it doesn’t work with buttons that inside a movie clip.

i need ur help  
thanks…

---

<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:** [April 30, 2003, 10:13pm UTC](https://forum.kirupa.com/t/disabling-a-button/19729/2 "2003-04-30T22:13:38Z")

</div>

Thats because you put \_root. which means it will look for the button on the main scene

You need to put the \_root.movieclipname.buttonname.enabled = false

And that is instance names not symbol names incase you not sure 🙂

Hope that helps

---

<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:** [May 1, 2003, 12:20am UTC](https://forum.kirupa.com/t/disabling-a-button/19729/3 "2003-05-01T00:20:11Z")

</div>

dear Lunar\_4u…  
that’s exactly what i’ve tried to do and it still doesn’t work…  
have any solution?

thanks for help

---

<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:** [May 1, 2003, 8:59am UTC](https://forum.kirupa.com/t/disabling-a-button/19729/4 "2003-05-01T08:59:52Z")

</div>

if the code is on the button iteself try it like this:

```auto

this.myButton.enabled = false;

```

where ‘myButton’ is the instance name of the 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:** [May 1, 2003, 9:03am UTC](https://forum.kirupa.com/t/disabling-a-button/19729/5 "2003-05-01T09:03:49Z")

</div>

Ok here is a fla mate

As you can see when the actionscript in the first frame set to false the button does not work. But change it to true it does. Sorry about the very poor desing and look i just wnated to show u the general idea 🙂

---

<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:** [May 1, 2003, 11:15am UTC](https://forum.kirupa.com/t/disabling-a-button/19729/6 "2003-05-01T11:15:08Z")

</div>

Hey everybody thanks alot…  
i knew the problem was the name of the movie clip because its name was “7” and it works now when its name is “movie”

that’s a strange thing to make an error :-\ but anyway thank Allah i knew it 🙂
