# Trying to get an object to follow the mouse

**URL:** https://forum.kirupa.com/t/trying-to-get-an-object-to-follow-the-mouse/305392
**Category:** Uncategorized
**Created:** [February 24, 2010, 2:44pm UTC](https://forum.kirupa.com/t/trying-to-get-an-object-to-follow-the-mouse/305392 "2010-02-24T14:44:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![earleaw](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@earleaw](https://forum.kirupa.com/u/earleaw)
#### Post date: [February 24, 2010, 2:44pm UTC](https://forum.kirupa.com/t/trying-to-get-an-object-to-follow-the-mouse/305392/1 "2010-02-24T14:44:46Z")

</div>

…without using the startDrag method. I know I can use code like this inside of a mouse event listener/function:

```auto
objectMC.x=mouseX;
objectMC.y=mouseY;

```

This code makes the object move with the mouse, but only if I move the mouse very slowly. When I move the mouse quickly, the mouse leaves the area of the object and thus the MOUSE\_OVER listener stops listening, causing the object to stop.

I hope this make sense and I apologize if this is the most noob-tastic question of the day.

Thanks,  
Earle
