# Change starDrag for onMouseMove

**URL:** <https://forum.kirupa.com/t/change-stardrag-for-onmousemove/252514>\
**Category:** flash\
**Created:** [February 20, 2008, 9:12pm UTC](https://forum.kirupa.com/t/change-stardrag-for-onmousemove/252514 "2008-02-20T21:12:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SopaSeco](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@SopaSeco](https://forum.kirupa.com/u/SopaSeco)\
**Post date:** [February 20, 2008, 9:12pm UTC](https://forum.kirupa.com/t/change-stardrag-for-onmousemove/252514/1 "2008-02-20T21:12:25Z")

</div>

Hello i try to change this code.

```auto
var RAD_DEG:Number = 180/Math.PI; // Variable to convert radians to degrees
Mouse.hide();
_root.createEmptyMovieClip("mouser", 1);
mouser.attachMovie("fly", "fly", 1);
mouser._x = _xmouse;
mouser._y = _ymouse;
mouser.oldY = mouser._y;
mouser.oldX = mouser._x;
mouser.startDrag(true);
// MONITOR THE SPEED AND DIRECTION OF THE MOVIE
mouser.onMouseMove = movement;
function movement() {
    mouser.dirX = mouser.oldX-mouser._x;
    mouser.dirY = mouser.oldY-mouser._y;
    mouser.oldX = mouser._x;
    mouser.oldY = mouser._y;
     // Calculate the angle of the mc based on the direction of movement
    myAngle = Math.atan2(mouser.dirY, mouser.dirX)*RAD_DEG;
    errorAngle = myAngle - mouser._rotation;
    if(Math.abs(errorAngle) > 5){
        if(((errorAngle > 0) && (errorAngle < 180)) || (errorAngle < -180)){
            mouser._rotation += 5;
        } else {
            mouser._rotation -= 5;
        }
    }
    updateAfterEvent();
}

```

The trouble is this, i have another starDrag in a scrollbar when i used tow times the personalize mouse doesn’t work. But i know i change the starDrag for onMouseMove, this work the trouble i don’t know who do this work.

An sorry for my bad english.☹
