# Movieclip over a Moveclip, both on stage, activate mouse event?

**URL:** <https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079>\
**Category:** flash\
**Created:** [May 22, 2008, 10:05pm UTC](https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079 "2008-05-22T22:05:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidOrtiz](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DavidOrtiz](https://forum.kirupa.com/u/DavidOrtiz)\
**Post date:** [May 22, 2008, 10:05pm UTC](https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079/1 "2008-05-22T22:05:59Z")

</div>

Hi got MC A and MC B. MC B is directly under MC A. They are both indepedent on the stage, meaning they are not children of a bigger mc container. They both have rollover events, how can I activate the rollover events of MC B???

Im aware of mouseChildren and mouseEnabled, but that requires them to be in the same container…

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [May 23, 2008, 12:10am UTC](https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079/2 "2008-05-23T00:10:29Z")

</div>

in as2, that top clip is always going to block the bottom clip mouse events. So, in the onRollOver event on the top clip, you’ll have to run a bit of logic to determine if the mouse is over the bottom clip. This can be done with hitTest or (imo a better/more accurate way) see if the mouse \_xmouse, \_ymouse are over the area of your bottom clip… if so, you can force a mcB.onRollOver(); event.

Hope this helps

---

<div class="post-metadata">

**Author:** ![DavidOrtiz](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@DavidOrtiz](https://forum.kirupa.com/u/DavidOrtiz)\
**Post date:** [May 23, 2008, 4:11am UTC](https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079/3 "2008-05-23T04:11:01Z")

</div>

ahhh, meant as3

---

<div class="post-metadata">

**Author:** ![Lou](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Lou](https://forum.kirupa.com/u/Lou)\
**Post date:** [May 23, 2008, 6:08am UTC](https://forum.kirupa.com/t/movieclip-over-a-moveclip-both-on-stage-activate-mouse-event/261079/4 "2008-05-23T06:08:32Z")

</div>

the way I would do it is to test the distance between the mouse and MC-B if the distance is low enough trigger an event.

dx = \_root.point1.\_x - \_root.point2.\_x  
dy = \_root.point1.\_y - \_root.point2.\_y  
distance = Math.sqrt((dx_dx)+(dy_dy))
