# No mouse movement

**URL:** <https://forum.kirupa.com/t/no-mouse-movement/208268>\
**Category:** flash\
**Created:** [November 27, 2006, 3:56am UTC](https://forum.kirupa.com/t/no-mouse-movement/208268 "2006-11-27T03:56:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpharaven](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alpharaven](https://forum.kirupa.com/u/alpharaven)\
**Post date:** [November 27, 2006, 3:56am UTC](https://forum.kirupa.com/t/no-mouse-movement/208268/1 "2006-11-27T03:56:06Z")

</div>

I need help coming up with a AS that if there is no mouse movement a function will be called. I have the following code but it does not always work. If the user moves the mouse too fast out of the SWF this code does not get called. Therefore the images in here do not get reseted.

```auto
var myListener = new Object ();
myListener.onMouseMove = function () {
    if ((_root._xmouse>=255) or (_root._ymouse>=255) or (_root._xmouse<=11) or (_root._ymouse<=11)) {
        reset ();
    }
    trace (_xmouse);
};
Mouse.addListener (myListener);

```
