# Button Deactivate

**URL:** <https://forum.kirupa.com/t/button-deactivate/188789>\
**Category:** flash\
**Created:** [May 10, 2006, 7:44pm UTC](https://forum.kirupa.com/t/button-deactivate/188789 "2006-05-10T19:44:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@Red](https://forum.kirupa.com/u/Red)\
**Post date:** [May 10, 2006, 7:44pm UTC](https://forum.kirupa.com/t/button-deactivate/188789/1 "2006-05-10T19:44:13Z")

</div>

Hello,

First off I would like to Thank Defective for helping me in the past with this issue - however Im still stumped. I have the following code for my buttons:

```auto

function resetall(){
    for(var i=1; i<=4; i++){
        var but:MovieClip = eval("button"+i)
        but.enabled=true;
        but.gotoAndPlay("mouse_out");
    }
}
button1.onRelease=function(){
 resetall();
 this.gotoAndStop("active");
    this.enabled=false;
 gotoAndPlay("home");
}

button1.onRollOver=function(){
 this.gotoAndPlay("mouse_over");
}
button1.onRollOut=function(){
 this.gotoAndPlay("mouse_out");
}
 
button2.onRelease=function(){
    resetall();
 this.gotoAndStop("active");
    this.enabled=false;
 gotoAndPlay("services");
}
 
button2.onRollOver=function(){
 this.gotoAndPlay("mouse_over");
}
button2.onRollOut=function(){
 this.gotoAndPlay("mouse_out");
}
button3.onRelease=function(){
    resetall();
 this.gotoAndStop("active");
    this.enabled=false;
 gotoAndPlay("Projects");
}
button3.onRollOver=function(){
 this.gotoAndPlay("mouse_over");
}
button3.onRollOut=function(){
 this.gotoAndPlay("mouse_out");
}
button4.onRelease=function(){
    resetall();
 this.gotoAndStop("active");
    this.enabled=false;
 gotoAndPlay("ContactUs");
}
button4.onRollOver=function(){
 this.gotoAndPlay("mouse_over");
}
button4.onRollOut=function(){
 this.gotoAndPlay("mouse_out");
}

```

What Im looking for the code to do is when a button is activated I would like the previously active button to play mouse\_out. But what is happening in this code is all of the buttons are playing mouse\_out when a new button is beinging activated and not just the previous active button. I have no idea how to fix it - please help.

Any help would be greatly appreciated.

Thank you,  
Red
