# Detecting the mouse position only over a movie clip

**URL:** <https://forum.kirupa.com/t/detecting-the-mouse-position-only-over-a-movie-clip/181929>\
**Category:** flash\
**Created:** [March 14, 2006, 10:55am UTC](https://forum.kirupa.com/t/detecting-the-mouse-position-only-over-a-movie-clip/181929 "2006-03-14T10:55:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![illuminare](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@illuminare](https://forum.kirupa.com/u/illuminare)\
**Post date:** [March 14, 2006, 10:55am UTC](https://forum.kirupa.com/t/detecting-the-mouse-position-only-over-a-movie-clip/181929/1 "2006-03-14T10:55:45Z")

</div>

Hey,  
Sitting here in a cold Oslo, really frustrated. Can anyone answer me how I can detect the x and y positions of the mouse only when it is over a specific movie clip? I do not want my function to run based on the x and y position of the mouse related to the movie, but only when the mouse is over a specific movie clip. The thing is, I must know the exact position relative to the borders of this movie clip. Any suggestions?

Many thanks

---

<div class="post-metadata">

**Author:** ![illuminare](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@illuminare](https://forum.kirupa.com/u/illuminare)\
**Post date:** [April 15, 2006, 9:04am UTC](https://forum.kirupa.com/t/detecting-the-mouse-position-only-over-a-movie-clip/181929/2 "2006-04-15T09:04:09Z")

</div>

Hi,  
Sorry for taking so long to respond. Many thanks for the help, I got it to work properly! Again, many thanks.

> [@bigmtnskier](#):
>
> Ye forgot a plus sign 😛  
> ActionScript Code:  
> [FONT=Courier New][LEFT][COLOR=#0000FF]onClipEvent[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
> [COLOR=#0000FF]if[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
> [COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“Relative Mouse Position: (”[/COLOR] +[COLOR=#0000FF]\_xmouse[/COLOR]+[COLOR=#FF0000]“, “[/COLOR]+[COLOR=#0000FF]\_ymouse[/COLOR]+[COLOR=#FF0000]”)”[/COLOR][COLOR=#000000])[/COLOR];  
> [COLOR=#000000]}[/COLOR]  
> [COLOR=#000000]}[/COLOR]  
> [/LEFT]  
> [/FONT]
