# onRollOver/onRollOut/onRelease issue

**URL:** <https://forum.kirupa.com/t/onrollover-onrollout-onrelease-issue/294766>\
**Category:** flash\
**Created:** [August 19, 2009, 4:02pm UTC](https://forum.kirupa.com/t/onrollover-onrollout-onrelease-issue/294766 "2009-08-19T16:02:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrancisBetty](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@FrancisBetty](https://forum.kirupa.com/u/FrancisBetty)\
**Post date:** [August 19, 2009, 4:02pm UTC](https://forum.kirupa.com/t/onrollover-onrollout-onrelease-issue/294766/1 "2009-08-19T16:02:17Z")

</div>

Hi all,  
Sorry if i’m posting something that has been discussed before but the only post i found regarding this was from [2006](http://www.kirupa.com/forum/showthread.php?t=225246), so i decided to start fresh.

The code here does the job, but the issue starts when i add a second button. The first one keeps the “onRelease” state, when it should jump out. I tried using a second variable, and changing states between them each time the onRelease state was active on one of the buttons, and still no luck.

Any ideas?

This code is for one button only:

```auto
/**/

pressed == false;
_root.submenu.subbtn1.onRollOver = function() {
		TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xEAF0A8,_alpha:100,ease:Cubic.easeOut});
		TweenMax.to(_root.submenu.subbtn1.subbtn1_text, 0.2, {_x:40,ease:Cubic.easeOut});
}
_root.submenu.subbtn1.onRollOut = function() {
		if (pressed == false) {
		TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xEEEEEE,_alpha:0,ease:Cubic.easeOut});
		TweenMax.to(_root.submenu.subbtn1.subbtn1_text, 0.2, {_x:35,ease:Cubic.easeOut});
		} else {
		pressed = false;
		}
}
_root.submenu.subbtn1.onRelease = function() {
		TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xe8f4a5,_alpha:100,ease:Cubic.easeOut});
		pressed = true;
}

/**/

```

Thanks in advance.
