# E:MouseEvent):void { e.mouse\_over = boolean?

**URL:** <https://forum.kirupa.com/t/e-mouseevent-void-e-mouse-over-boolean/269525>\
**Category:** Uncategorized\
**Created:** [August 28, 2008, 4:05pm UTC](https://forum.kirupa.com/t/e-mouseevent-void-e-mouse-over-boolean/269525 "2008-08-28T16:05:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeonardoZimbres](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/leonardozimbres/32/4035_2.png) [@LeonardoZimbres](https://forum.kirupa.com/u/LeonardoZimbres)\
**Post date:** [August 28, 2008, 4:05pm UTC](https://forum.kirupa.com/t/e-mouseevent-void-e-mouse-over-boolean/269525/1 "2008-08-28T16:05:52Z")

</div>

I was doing a simple button with mouse on and over actions…

objection.addEventListener(MouseEvent.MOUSE\_OVER,obj);  
objection.addEventListener(MouseEvent.MOUSE\_OUT,obj);

And then I got this idea, why not to use the sane function for both events? Then when inside the function, I could ask if the event was MOUSE\_OVER or OUT?  
Something like this:

function obj(e:MouseEvent):void {  
Do\_something()  
if(e.mouse\_on==true){  
Do\_another\_thing  
} else {  
Restore\_Cuba\_democracy()  
}  
}

Theres someting like this availble in as 3.0? I googled a little and found nothing. Maybe I used the wrong words in search…  
By the way, the Cuba Democracy is a joke. I dont know how Cuba is and I dont care too. I like because the episode where SouthPark guys done that.

}
