# Disable some buttons

**URL:** <https://forum.kirupa.com/t/disable-some-buttons/187181>\
**Category:** Uncategorized\
**Created:** [April 27, 2006, 7:44am UTC](https://forum.kirupa.com/t/disable-some-buttons/187181 "2006-04-27T07:44:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim1](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jim1](https://forum.kirupa.com/u/jim1)\
**Post date:** [April 27, 2006, 7:44am UTC](https://forum.kirupa.com/t/disable-some-buttons/187181/1 "2006-04-27T07:44:59Z")

</div>

new to forums 🙂 and thank you kiruapa and others for this forums

my question is to disable some buttons and clear or delete loaded swf

i attached this code to the buttons

on (release) {  
//content: is an empty movie  
content.loadMovie(“page2.swf”);  
//mybutton: is the instance name of the button  
mybutton1.enabled=false;  
mybutton2.enabled=false;  
}

the code works fine, the loaded swf has close button, when i click close button it playe the movie lets say the movie goes from 100 to 0 as alpha. and the buutons anabled again.

on (release) {  
play();  
\_root.mybutton1.enabled=enabled;  
\_root.mybutton2.enabled=enabled;  
}

- is the loaded movie still there, if so, how to remove it.
- if i have many buttons, how to shorten the code and edit it easily.

thanks for your patience

---

<div class="post-metadata">

**Author:** ![mngBJ](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mngBJ](https://forum.kirupa.com/u/mngBJ)\
**Post date:** [May 1, 2006, 12:51am UTC](https://forum.kirupa.com/t/disable-some-buttons/187181/2 "2006-05-01T00:51:14Z")

</div>

> [@\_jim](#):
>
> thanks man
> 
> but i really i did not understand this code:
> 
> ```php
> on(release){
> for(i=1; i<=btnCount; i++){
> _root["myButton"+i].enabled = true;
> }
> }
> 
> ```
> 
> i=1: does this mean “i” is a variable

yeah i is a variable.  
for(i=1; i\<=btnCount; i++) means i starts 1 and adding 1 to until btnCount.

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [May 1, 2006, 1:01am UTC](https://forum.kirupa.com/t/disable-some-buttons/187181/3 "2006-05-01T01:01:35Z")

</div>

> [@\_jim](#):
>
> by the way
> 
> how can i display actioscript format in the forum  
> in the prev post i used PHP
> 
> thanks again

[noparse]

```auto

```

[/noparse]🙂
