# onMouseMove

**URL:** <https://forum.kirupa.com/t/onmousemove/5657>\
**Category:** flash\
**Created:** [September 18, 2002, 9:35pm UTC](https://forum.kirupa.com/t/onmousemove/5657 "2002-09-18T21:35:02Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 20, 2002, 4:24pm UTC](https://forum.kirupa.com/t/onmousemove/5657/21 "2002-09-20T16:24:25Z")

</div>

```auto

theMovie.onRollOver = function(){
   this.onMouseMove = function(){
      if(this.oldx < this._xmouse){
         this.prevFrame();
      }else{
         this.nextFrame();
      }
   this.oldx = this._xmouse;
}

theMovie.onRollOut = function(){
   this.onMouseMove = null;
}

```

i’ve inserted it into the code i wrote earlier, but the same strategy should work in any code.

[Previous page](https://forum.kirupa.com/t/onmousemove/5657.md?page=1)
