# Disable button

**URL:** <https://forum.kirupa.com/t/disable-button/9385>\
**Category:** flash\
**Created:** [December 10, 2002, 7:42pm UTC](https://forum.kirupa.com/t/disable-button/9385 "2002-12-10T19:42:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chivo01](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@Chivo01](https://forum.kirupa.com/u/Chivo01)\
**Post date:** [December 10, 2002, 7:42pm UTC](https://forum.kirupa.com/t/disable-button/9385/1 "2002-12-10T19:42:52Z")

</div>

I need some help, I have a button that loads a movie, and after it loads that movie I want it to be disabled so I used this scrpit

on (release) {  
button.enabled = false;  
}

and does work

however after the movie clip is through playing and a button is pressed that unloads it I want the button to be enabled agian.  
this is where I get confused.

any help would be great.

---

<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:** [December 10, 2002, 8:17pm UTC](https://forum.kirupa.com/t/disable-button/9385/2 "2002-12-10T20:17:17Z")

</div>

just put on your other button

```auto
on (release){
	button.enabled = true;
}

```

---

<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:** [December 11, 2002, 5:18am UTC](https://forum.kirupa.com/t/disable-button/9385/3 "2002-12-11T05:18:57Z")

</div>

I did try that code, it on;y makes sence, but it didn’t work.???  
the button that would enable the button is also the button that unloads the movie clip

---

<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:** [December 11, 2002, 8:13am UTC](https://forum.kirupa.com/t/disable-button/9385/4 "2002-12-11T08:13:25Z")

</div>

an idea:

1 add code to the button so that the first thing it does is check whether mc\_finished=true (set a variable at the end of your movie); if true, do button stuff, else exit (so no code is executed)

---

<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:** [December 11, 2002, 3:54pm UTC](https://forum.kirupa.com/t/disable-button/9385/5 "2002-12-11T15:54:40Z")

</div>

OK this is what I’m trying and its not working, I suck when it comes to actionscript. On the first button I put

on (release) {  
if (chirsclip\_finished = false) {  
chrisbutton.enabled = false;

} else {  
chrisbutton.enabled = true  
}

so what that should do is check to see if the movie clip chirsclip is finished and if not disable the button, so at the end of the chirsclip I put

chirsclip\_finished = “true”;  
stop();

now I’m sure I’m doing something wrong with declaring the variable, just because I’m not sure what that is.

thanks for your help:asian:

---

<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:** [December 11, 2002, 6:45pm UTC](https://forum.kirupa.com/t/disable-button/9385/6 "2002-12-11T18:45:45Z")

</div>

add an \_root. before your variables and enable commands and see if 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:** [December 11, 2002, 6:51pm UTC](https://forum.kirupa.com/t/disable-button/9385/7 "2002-12-11T18:51:15Z")

</div>

wait i see a couple of other things

```auto

on (release) {
	if (_root.chirsclip_finished == false) {
		_root.chrisbutton.enabled = false;
	} else {
		_root.chrisbutton.enabled = true;
	}
}

then at on your chirsclip change your code to this:

_root.chirsclip_finished = true;
stop();

```
