# Follow mouse along X-cord

**URL:** https://forum.kirupa.com/t/follow-mouse-along-x-cord/20291
**Category:** flash
**Created:** [May 7, 2003, 5:21am UTC](https://forum.kirupa.com/t/follow-mouse-along-x-cord/20291 "2003-05-07T05:21:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rowdy](https://avatars.discourse-cdn.com/v4/letter/r/a698b9/32.png) [@rowdy](https://forum.kirupa.com/u/rowdy)
#### Post date: [May 7, 2003, 5:21am UTC](https://forum.kirupa.com/t/follow-mouse-along-x-cord/20291/1 "2003-05-07T05:21:29Z")

</div>

Does anyone know how to make a small graphic follow the mouse along a X-cord or a line.

a bonus would be for it to ease in and/or out.

If anyone knows how, or have an .fla example, me would be very happy.

Thanks.

Using Flash MX Actionscript

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 7, 2003, 8:38am UTC](https://forum.kirupa.com/t/follow-mouse-along-x-cord/20291/2 "2003-05-07T08:38:22Z")

</div>

Try searching the tutorials. I know that it’s already there!

The basic script is

Flash 5:  
[AS]  
onClipEvent(enterFrame){  
\_x += (\_root.\_xmoouse - \_x/3;  
}  
[/AS]

Try the tutorials, you’ll learn faster there!
