# Move left and right with mouse

**URL:** https://forum.kirupa.com/t/move-left-and-right-with-mouse/248920
**Category:** flash
**Created:** [January 13, 2008, 11:32am UTC](https://forum.kirupa.com/t/move-left-and-right-with-mouse/248920 "2008-01-13T11:32:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![awebbdesign](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@awebbdesign](https://forum.kirupa.com/u/awebbdesign)
#### Post date: [January 13, 2008, 11:32am UTC](https://forum.kirupa.com/t/move-left-and-right-with-mouse/248920/1 "2008-01-13T11:32:53Z")

</div>

Hi Can anyone help me with moving a image left and right depending on the mouse position like the following…

[http://www.assness.com/](http://www.assness.com/)

I had the following…

// now i need the mouse to move

```
mspeed = 5
endX = _root._xmouse;
_x += (endX-_x)/mspeed;

```

But the image just follows the mouse, ideally I need it to keep on moving left or right (unless the mouse is in the center) any help please?
