# mouseEnabled Not Working As Expected

**URL:** <https://forum.kirupa.com/t/mouseenabled-not-working-as-expected/229948>\
**Category:** flash\
**Created:** [June 21, 2007, 2:20pm UTC](https://forum.kirupa.com/t/mouseenabled-not-working-as-expected/229948 "2007-06-21T14:20:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![douglaae](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@douglaae](https://forum.kirupa.com/u/douglaae)\
**Post date:** [June 21, 2007, 2:20pm UTC](https://forum.kirupa.com/t/mouseenabled-not-working-as-expected/229948/1 "2007-06-21T14:20:39Z")

</div>

Hello. I have a MovieClip on the stage that’s operating as a button with ROLL\_OVER, ROLL\_OUT, and CLICK events established. In the CLICK event, I want to disable the button through: theMovie.mouseEnabled = false, but it’s not working! The ROLL\_OVER, ROLL\_OUT and CLICK events continue to fire despite trace statements confirming that mouseEnabled = false! Here’s the code:

private function clickHandler(evt:MouseEvent):void {  
//do some stuff…  
var selectedClip:MovieClip = MovieClip(evt.currentTarget);  
selectedClip.mouseEnabled = false; //mouse events are still enabled after this runs!  
selectedClip.buttonMode = false; //this works  
}

private function rollOverHandler(evt:MouseEvent):void {  
//now that mouseEnabled = false, this event shouldn’t fire, but it does!  
//what’s worse - the trace below confirms that mouseEnabled = false! shenannigans!  
trace(“this shouldn’t be displayed at all”, evt.currentTarget.mouseEnabled);  
}

If anyone has any insight as to what’s happening here, I would be grateful for your help! Thanks!

Andy
