# If statement?

**URL:** <https://forum.kirupa.com/t/if-statement/191712>\
**Category:** Uncategorized\
**Created:** [June 22, 2006, 1:36pm UTC](https://forum.kirupa.com/t/if-statement/191712 "2006-06-22T13:36:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rynobot](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rynobot](https://forum.kirupa.com/u/rynobot)\
**Post date:** [June 22, 2006, 1:36pm UTC](https://forum.kirupa.com/t/if-statement/191712/1 "2006-06-22T13:36:15Z")

</div>

I have a MovieClip with 3 functions to act as a button - onRollover, onRollout, onRelease.  
I want the onRelease function to cancel out the other functions once the user presses the button.

How would I script that?

```auto
navMenu1.onRollOver = function() {
	_parent.jumpTobg1X(2);
	this.gotoAndPlay("over");
};
navMenu1.onRollOut = function() {
	_root.jumpTobg1X(2);
	this.gotoAndPlay("off");
};
navMenu1.onRelease = function() {
	_root.jumpTobg1X(3);
	this.gotoAndPlay("on");
};

```

Basically, I have the function sliding another movieclip along the x axis. onRelease it slide to position 3 - which I want it to stay there, but my onRollout function keeps sliding it back to position 2 (which i need for users just browsing the navigation before a selection is made)

what is the best way to go about coding this?
