# RollOver/RollOut Button Issue... Need Help!

**URL:** https://forum.kirupa.com/t/rollover-rollout-button-issue-need-help/125330
**Category:** Uncategorized
**Created:** [October 12, 2004, 5:01pm UTC](https://forum.kirupa.com/t/rollover-rollout-button-issue-need-help/125330 "2004-10-12T17:01:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BlackShadow](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@BlackShadow](https://forum.kirupa.com/u/BlackShadow)
#### Post date: [October 12, 2004, 5:01pm UTC](https://forum.kirupa.com/t/rollover-rollout-button-issue-need-help/125330/1 "2004-10-12T17:01:45Z")

</div>

Hey,

```
 Well, I have 4 buttons on the menu and I'm sort of using a hitTest type of way of playing the RollOver's. I'm using this code on a seperate Layer to work with them...

```

```auto
for (all in this) {
	if (this[all] instanceof Button && this[all]._name.substr(0, 3) == "btn") {
		this[all].onRollOver = function() {
			this._parent["mc"+this._name.substr(3, 1)].onEnterFrame = function() {
				this.nextFrame();
				if (this._currentframe == 25) {
					delete this.onEnterFrame;
				}
			};
		};
		this[all].onRollOut = function() {
			this._parent["mc"+this._name.substr(3, 1)].onEnterFrame = function() {
				this.prevFrame();
				if (this._currentframe == 1) {
					delete this.onEnterFrame;
				}
			};
		};
	}
}

```

And what I want them each to do is, when one is clicked on, it freezes in place and becomes disabled. Then, when a different one is clicked, the previous one becomes enabled and plays through the rollout back into position. Can any help me on this?

Thanks again.
