# HELP: Disabling Button AS not working

**URL:** https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225
**Category:** flash
**Created:** [September 24, 2004, 5:30am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225 "2004-09-24T05:30:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![BUroKHUli](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/burokhuli/32/190_2.png) [@BUroKHUli](https://forum.kirupa.com/u/BUroKHUli)
#### Post date: [September 24, 2004, 5:30am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/1 "2004-09-24T05:30:53Z")

</div>

Hello again,

I have 4 buttons on a timeline, and each loads different external SWFs. I want that when I clicked on 1 button, let’s say the “button1”, it will load the MOVIE and the button will be disable until I have clicked on another button. I tried this script below but didn’t get any RESULT.

on (release) {  
if (expand == 0) {  
gotoAndPlay(“AA”);  
\_parent.pointerMC.gotoAndPlay(“BB”);  
} else {  
gotoAndStop(currentFrame);  
}  
\_parent.containerMC.loadMovie(“movieMC.swf”);  
expand = 1;  
\_parent.button1.enabled = false;  
\_parent.button2.enabled = true;  
\_parent.button3.enabled = true;  
\_parent.button4.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: [September 24, 2004, 5:32am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/2 "2004-09-24T05:32:11Z")

</div>

disabled how? like you can’t roll over it? or when you click it does nothing?

---

<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: [September 24, 2004, 5:42am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/3 "2004-09-24T05:42:31Z")

</div>

The above script works, but only on the 2nd CLICK of the button. LOL. Anyway, is there anyway of disabling buttons in Flash other than “???.enabled = true;” AS?

---

<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: [September 24, 2004, 5:43am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/4 "2004-09-24T05:43:49Z")

</div>

enabled = false; totally disabled the button. My script above worked but not on the first click, but on the 3rd click. hehehe!! I’ve been playing around with it. Any help is appreciated.

---

<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: [September 24, 2004, 5:56am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/5 "2004-09-24T05:56:19Z")

</div>

you can make them invisible or you can add an if statement that judges wether or not to do something. like as in: if the section the button loads, is not loaded, load it, other wise do nothing… this is probably the standard way to do 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: [September 24, 2004, 6:06am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/6 "2004-09-24T06:06:45Z")

</div>

3reye Thanks. I’m looking for some TUTs here about disabling buttons and hope to apply it on my movies.

---

<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: [September 24, 2004, 6:38am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/7 "2004-09-24T06:38:13Z")

</div>

3reye

Here is the file I have been practicing on. It’s a TUT I got from the site.

---

<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: [September 24, 2004, 8:16am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/8 "2004-09-24T08:16:06Z")

</div>

I was thinkig of incorporating this PSEUDOCODE to my script above.

if (myClip.swf==Loaded) {  
buttonName.enable = false;  
} else {  
buttonName.enable = true;  
}

Need a little 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: [September 24, 2004, 8:23am UTC](https://forum.kirupa.com/t/help-disabling-button-as-not-working/65225/9 "2004-09-24T08:23:23Z")

</div>

i hope this works:  
give every button a name (ex. b1, b2, …)  
and add the code(change b1 and movie1):  
on (release) {  
\_root[\_root.currentMovie].enabled = true;  
\_root.currentMovie = “b1”;  
\_root.containerMC.loadMovie(“movie1.swf”);  
\_root.b1.enabled = false;  
}
