# Track mouse/curser in actionscript 3 help

**URL:** https://forum.kirupa.com/t/track-mouse-curser-in-actionscript-3-help/274809
**Category:** flash
**Created:** [November 5, 2008, 9:04am UTC](https://forum.kirupa.com/t/track-mouse-curser-in-actionscript-3-help/274809 "2008-11-05T09:04:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sw2geeks](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sw2geeks](https://forum.kirupa.com/u/sw2geeks)
#### Post date: [November 5, 2008, 9:04am UTC](https://forum.kirupa.com/t/track-mouse-curser-in-actionscript-3-help/274809/1 "2008-11-05T09:04:38Z")

</div>

I have some actionscript 2 code I use to reposition a hover caption when the  
mouse/curser gets close to the bottom of the stage.

But I am not sure how to do the same thing in actionscript 3.  
Thanks for any help.

if (\_ymouse \> 350) {

xo = 0;  
yo = -110;

} else {

xo = 0;  
yo = 0;

}

hoverCaption.onEnterFrame = function() {  
info.\_x = \_root.\_xmouse+xo;  
info.\_y = \_root.\_ymouse+yo;

info.\_visible = true;

};

} else {

delete hoverCaption.onEnterFrame;  
info.\_visible = false;

}
