# Button mc and "if" state

**URL:** <https://forum.kirupa.com/t/button-mc-and-if-state/233595>\
**Category:** flash\
**Created:** [July 25, 2007, 10:05am UTC](https://forum.kirupa.com/t/button-mc-and-if-state/233595 "2007-07-25T10:05:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MASAKR](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@MASAKR](https://forum.kirupa.com/u/MASAKR)\
**Post date:** [July 25, 2007, 10:05am UTC](https://forum.kirupa.com/t/button-mc-and-if-state/233595/1 "2007-07-25T10:05:55Z")

</div>

Hi. I have a button mc using the following code:

```auto
_root.folio.but1.onRollOver = function() {
		this.gotoAndStop(2);
	this.onRollOut = function() {
		this.gotoAndStop(1);
	this.onRelease = function() {
		this.gotoAndStop(3);
};
};
};

```

I need the last bit of code to make it stay at the mcs frame nr. 3 after clicking it (though I still want it to go to frame 2 on rollOver). I have tried using the “if” state, but cant get it right. I am thinking it must be a way to write a code that says something like: If I go to frame three, disable the code gotoAndStop(1).

Anyone have a clue?
