# Mouse move start and end difference

**URL:** <https://forum.kirupa.com/t/mouse-move-start-and-end-difference/241523>\
**Category:** Uncategorized\
**Created:** [October 15, 2007, 8:53am UTC](https://forum.kirupa.com/t/mouse-move-start-and-end-difference/241523 "2007-10-15T08:53:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yura](https://avatars.discourse-cdn.com/v4/letter/y/e0b2c6/32.png) [@yura](https://forum.kirupa.com/u/yura)\
**Post date:** [October 15, 2007, 8:53am UTC](https://forum.kirupa.com/t/mouse-move-start-and-end-difference/241523/1 "2007-10-15T08:53:36Z")

</div>

i have built a navigation circle with a rotating handle  
what i am trying to accomplish is

on mousemove  
if the rotation end position is greater then rotation start position  
the links movieclip go to the next frame other wise it goes to the previous frame

[COLOR=Red]in red is where i’m having trouble[/COLOR]

rotFun = function () {

```
var dx:Number = _xmouse-this._x;
var dy:Number = _ymouse-this._y;        
var radians:Number = Math.atan2(dy, dx);
var degrees:Number = 360*radians/(2*Math.PI);

    this._rotation = degrees;

```

[COLOR=Red] if(this.\_rotation++){  
\_root.dial.links\_mc.nextFrame()}

```
else{ _root.dial.links_mc.prevFrame()

```

}[/COLOR]

}

knob.useHandCursor = true;  
knob.onPress = function() {  
this.onMouseMove = rotFun;  
}

knob.onRelease = knob.onReleaseOutside=function () {

```
 _root.dial.knob._alpha = 100
 delete this.onMouseMove; 

```

};
