# On(rollOver) and on(rollOut) issue

**URL:** <https://forum.kirupa.com/t/on-rollover-and-on-rollout-issue/273346>\
**Category:** Uncategorized\
**Created:** [October 14, 2008, 5:32pm UTC](https://forum.kirupa.com/t/on-rollover-and-on-rollout-issue/273346 "2008-10-14T17:32:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![No\_44](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@No\_44](https://forum.kirupa.com/u/No_44)\
**Post date:** [October 14, 2008, 5:32pm UTC](https://forum.kirupa.com/t/on-rollover-and-on-rollout-issue/273346/1 "2008-10-14T17:32:09Z")

</div>

Hello all,

I am having a bit of a frustrating problem with a button state. I have a button with the following code:

Code:  
on(rollOver) {  
this.gotoAndStop(2);  
}  
on(rollOut) {  
this.gotoAndStop(1);  
}  
then on Frame (2) I have only:  
Code:  
on(rollOut){  
this.gotoAndStop(1);  
}  
Everything works really nicely except when I mouse through the button very quickly, and it stays on the rollOver state, or Frame 2.

I have tried to use the Hittest function, however, on Frame 2 another button shows up on top of the original (an X so that the original button can be closed, like closing a pop-up window in XP) and when you are over it, the hittest fails, making the MC go back to Frame (1).

Basically what I am doing is creating a room with various furniture. Maybe you place a couple desks in the room, but then you decide you want to get rid of one. I want to enable the user to rollOver the desk, see the red X button appear, and click it to remove that specific desk.

Does anyone know a quick fix to this? Any help is greatly appreciated. The Fla is attached.
