# Line for x, y to cursor

**URL:** <https://forum.kirupa.com/t/line-for-x-y-to-cursor/120471>\
**Category:** Uncategorized\
**Created:** [August 24, 2004, 5:42pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/120471 "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/120471/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:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [August 24, 2004, 5:55pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/120471/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:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 24, 2004, 6:01pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/120471/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:** ![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, 6:50pm UTC](https://forum.kirupa.com/t/line-for-x-y-to-cursor/120471/4 "2004-08-24T18:50:05Z")

</div>

thanks for the replies.
