# Trouble with lineTo

**URL:** https://forum.kirupa.com/t/trouble-with-lineto/111468
**Category:** Uncategorized
**Created:** [May 27, 2004, 5:53am UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468 "2004-05-27T05:53:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![voidoid](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@voidoid](https://forum.kirupa.com/u/voidoid)
#### Post date: [May 27, 2004, 5:53am UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/1 "2004-05-27T05:53:57Z")

</div>

I’m new so please bear w/ me…  
On the main stage i have a movie clip that contains a movie clip that contains a bitmap (\_root.movieclip1.movieclip2.bitmap). The actions for the instance of movieclip2 cause the bitmap to follow a sine wave path across the stage.  
I’d like to draw a line behind the bitmap, so I created another movieclip on the main stage that has these actions:

onClipEvent (load) {  
moveTo (##x and y positions from other movieclip##);  
}

onClipEvent (enterFrame) {  
lineStyle (5, 0xff00ff, 100);  
lineTo (##x and y positions from other movieclip##);  
}

the timeline only has one frame (can this be done with only one frame??)  
anyway, I’m lost and would appreciate some help, thanks in advance.

---

<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 27, 2004, 1:09pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/2 "2004-05-27T13:09:11Z")

</div>

So what does it do?

---

<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 27, 2004, 2:31pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/3 "2004-05-27T14:31:34Z")

</div>

It does nothing, there are no lines, just the bitmaps moving across the stage.

---

<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 27, 2004, 3:40pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/4 "2004-05-27T15:40:56Z")

</div>

Isn’t that because if you use the lineTo command it acts alot like the moveTo command.  
Difference: moveto only moves your pen to the point specified. Lineto moves the pen to that specific point, but also draws a line from the starting point.

In other words if you use the lineto command in the way you are trying to do, it is basically trying to draw a line from your coordinates to the same coordinates, thus not drawing any visible line.

---

<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 27, 2004, 10:30pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/5 "2004-05-27T22:30:22Z")

</div>

so how could i get the line drawn? i’m stuck

---

<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 28, 2004, 12:19pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/6 "2004-05-28T12:19:38Z")

</div>

Are you sure it’s not a scope issue? Can you trace the coordinates of that clip you’re tracking?

---

<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 28, 2004, 1:03pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/7 "2004-05-28T13:03:25Z")

</div>

hey nah what ur missing is moveTo  
so  
moveTo(object.\_x,object.\_y)  
lineTo(object1.\_x,object.\_y)  
thats what ur trying to do right i made an example kinda thing for fun i call it the funlines  
[http://home.1asphost.com/lordsamot/funlines.swf](http://home.1asphost.com/lordsamot/funlines.swf)

---

<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 28, 2004, 2:15pm UTC](https://forum.kirupa.com/t/trouble-with-lineto/111468/8 "2004-05-28T14:15:51Z")

</div>

Nope. lineTo also moves the pen, so I think the problem comes from something else.
