# Line for x, y to cursor

**URL:** https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067
**Category:** Uncategorized
**Created:** [August 24, 2004, 5:42pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067 "2004-08-24T17:42:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)
#### Post date: [August 24, 2004, 5:42pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067/1 "2004-08-24T17:42:17Z")

</div>

How do you use the drawAPIs to make a link go from one point on the stage,to the mouse. i mean so that it updates, the line is constantly following the mouse.

Thanks 🙂

---

<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: [August 24, 2004, 5:55pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067/2 "2004-08-24T17:55:59Z")

</div>

```auto
mcToDrawIn.onEnterFrame = function(){
     this.clear();
     this.lineStyle(0,0,100);
     this.moveTo(x,y); // use desired starting location
     this.lineTo(this._xmouse, this._ymouse);
}

```

---

<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: [August 24, 2004, 6:01pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067/3 "2004-08-24T18:01:16Z")

</div>

> [@cyberathlete](#):
>
> How do you use the drawAPIs to make a link go from one point on the stage,to the mouse. i mean so that it updates, the line is constantly following the mouse.
> 
> Thanks 🙂

\_root.createEmptyMovieClip(“pen”, 100);  
pen.onMouseMove = function() {  
clear();  
lineStyle(3, 0xFF0000, 100);  
moveTo(275, 200);  
lineTo(\_xmouse, \_ymouse);  
};

EDIT/ didn`t see sens post

---

<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: [August 24, 2004, 6:50pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/62067/4 "2004-08-24T18:50:05Z")

</div>

thanks for the replies.
