# Mouse problem

**URL:** <https://forum.kirupa.com/t/mouse-problem/213179>\
**Category:** Uncategorized\
**Created:** [January 17, 2007, 2:46pm UTC](https://forum.kirupa.com/t/mouse-problem/213179 "2007-01-17T14:46:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimisNew](https://avatars.discourse-cdn.com/v4/letter/t/f6c823/32.png) [@TimisNew](https://forum.kirupa.com/u/TimisNew)\
**Post date:** [January 17, 2007, 2:46pm UTC](https://forum.kirupa.com/t/mouse-problem/213179/1 "2007-01-17T14:46:19Z")

</div>

hey everyone.  
i tryed to make a flash game and encountered some problems using my mouse.  
the game works completely fine if the user uses the arrow keys on his keyboard but when it comes to using the mouse, 20 seconds before the game quits everything jiggles around and the performance becomes really bad.

is there anyone who knows why this could occur?

here is the script thats on the movieclip following the mouse or the key which is pressed:

```auto

onClipEvent(load){
    speed = 35;
    }
onClipEvent (enterFrame) {
    var noise = new Object();
    noise.onMouseMove = function (){
        _x = _root._xmouse;
        }
    Mouse.addListener(noise);
    //
    if((Key.isDown(Key.RIGHT))){
        this._x += speed;
        }    
    else if((Key.isDown(Key.LEFT))){
        this._x -= speed;
        }
    //
    if (_x <= 140) {
        _x = 140;
    }
    if (_x >=750) {
        _x = 750;
    }
}

```

i’d be gratefull for any help provided.  
tim.
