# Multistate Button?

**URL:** https://forum.kirupa.com/t/multistate-button/227970
**Category:** flash
**Created:** [June 4, 2007, 10:19am UTC](https://forum.kirupa.com/t/multistate-button/227970 "2007-06-04T10:19:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Raziel](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Raziel](https://forum.kirupa.com/u/Raziel)
#### Post date: [June 4, 2007, 10:19am UTC](https://forum.kirupa.com/t/multistate-button/227970/1 "2007-06-04T10:19:11Z")

</div>

Hello,

I’m trying to make a button that has an animation as well as a function. Currently i have an MC with an animation in it and on roll over/out it plays forward or in reverse. Now I’ve tried adding a function that when clicked, the animation goes straight to the end of the animation until clicked again.

```auto

onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		_root.diagram.bottom_2_MC.nextFrame();
	} else {
		_root.diagram.bottom_2_MC.prevFrame();
	}
}

```

Tried with variables, setting whether or not it was clicked, yes or no. But the enterFrame kept resetting it.

Anyone have any suggestion on how to achieve this?
