# Removing and restoring with actionscript on button event

**URL:** <https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206>\
**Category:** Uncategorized\
**Created:** [September 5, 2003, 4:01am UTC](https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206 "2003-09-05T04:01:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmattx](https://avatars.discourse-cdn.com/v4/letter/x/6de8d8/32.png) [@xmattx](https://forum.kirupa.com/u/xmattx)\
**Post date:** [September 5, 2003, 4:01am UTC](https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206/1 "2003-09-05T04:01:00Z")

</div>

this has to be simple

I have 3 movie clips. Each one is a button, on mouse over on each I want the button rolled over to make the other 2 invisable to the viewer, and then on mouse out i want them to be restored.

I have been trying to figure it out with no luck. Tried setting something up with 1=visable 2=non, and use these commands on mouse events… im getting stuck however. thank you for any help.

button instance names:  
show  
photo  
book

thanks again.

---

<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 5, 2003, 4:09am UTC](https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206/2 "2003-09-05T04:09:53Z")

</div>

[AS]buttons\_array = [“show”, “photo”, “book”];  
function enableButton() {  
this.\_visible = true;  
for (var i in buttons\_array) {  
if (this.\_parent[buttons\_array\*].\_name != this.\_name) {  
this.\_parent[buttons\_array\*].\_visible = false;  
}  
}  
}  
for (var j in buttons\_array) {  
this[buttons\_array[j]].onRollOver = enableButton;  
this[buttons\_array[j]].onRollOut = function() {  
for (var k in buttons\_array) {  
this.\_parent[buttons\_array[k]].\_visible = 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 5, 2003, 4:35am UTC](https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206/3 "2003-09-05T04:35:53Z")

</div>

thank you very much

---

<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 5, 2003, 4:38am UTC](https://forum.kirupa.com/t/removing-and-restoring-with-actionscript-on-button-event/30206/4 "2003-09-05T04:38:14Z")

</div>

welcome 😉
