# Can you have two items follow the mouse?

**URL:** https://forum.kirupa.com/t/can-you-have-two-items-follow-the-mouse/259882
**Category:** flash
**Created:** [May 9, 2008, 6:15pm UTC](https://forum.kirupa.com/t/can-you-have-two-items-follow-the-mouse/259882 "2008-05-09T18:15:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Line](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@Line](https://forum.kirupa.com/u/Line)
#### Post date: [May 9, 2008, 6:15pm UTC](https://forum.kirupa.com/t/can-you-have-two-items-follow-the-mouse/259882/1 "2008-05-09T18:15:31Z")

</div>

Can you have two items follow the mouse?

I want to have one item moving with the cursor. The second MC to stay at its current y coordinate but move on the x to follow the mouse.

If you have a script, please post 🙂

Thanks.

---

<div class="post-metadata">

### Author: ![joran420](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joran420/32/2329_2.png) [@joran420](https://forum.kirupa.com/u/joran420)
#### Post date: [May 9, 2008, 6:50pm UTC](https://forum.kirupa.com/t/can-you-have-two-items-follow-the-mouse/259882/2 "2008-05-09T18:50:45Z")

</div>

\_xfollow\_mc.onEnterFrame = function(){  
this.\_x = \_xmouse  
}  
\_mousefollow\_mc.onEnterFrame = function(){  
this.\_x = \_xmouse  
this.\_y = \_ymouse

}  
…?? that should work fine…

---

<div class="post-metadata">

### Author: ![Line](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@Line](https://forum.kirupa.com/u/Line)
#### Post date: [May 9, 2008, 7:26pm UTC](https://forum.kirupa.com/t/can-you-have-two-items-follow-the-mouse/259882/3 "2008-05-09T19:26:28Z")

</div>

Joran you rock!

That worked perfectly!

Thanks a ton,  
-Line
