# Button movie - stay down on click

**URL:** https://forum.kirupa.com/t/button-movie-stay-down-on-click/176226
**Category:** Uncategorized
**Created:** [January 21, 2006, 8:33pm UTC](https://forum.kirupa.com/t/button-movie-stay-down-on-click/176226 "2006-01-21T20:33:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dirksmith](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dirksmith](https://forum.kirupa.com/u/dirksmith)
#### Post date: [January 21, 2006, 8:33pm UTC](https://forum.kirupa.com/t/button-movie-stay-down-on-click/176226/1 "2006-01-21T20:33:39Z")

</div>

Hi

I’ve implemented the script below to control some button movies - and it works fine.

But I’d like the script to instruct the button to stay down once clicked - and then for it to revert to the up state (frame 1) when another button is clicked.

So the current page is always indicated by a down state (frame 4).

Any ideas on how the script can be adjusted to achieve this?

Thanx

Dirk

total = 7;//  
this.onEnterFrame = function() {  
for (var i = 1; i\<=total; i++) {  
if (this[“button”+i].\_currentframe != 7) {  
if (this[“button”+i].hitTest(\_xmouse, \_ymouse, false)) {  
this[“button”+i].gotoAndStop(4); //  
} else {  
this[“button”+i].gotoAndStop(1);  
}  
}  
}  
};  
for (var i = 1; i\<=total; i++) {  
this[“button”+i].onPress = function() {  
this.gotoAndStop(4); //  
};  
}
