# LineTo drawing a single line using animation

**URL:** <https://forum.kirupa.com/t/lineto-drawing-a-single-line-using-animation/316524>\
**Category:** flash\
**Created:** [November 24, 2010, 11:05am UTC](https://forum.kirupa.com/t/lineto-drawing-a-single-line-using-animation/316524 "2010-11-24T11:05:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![black\_pearl](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@black\_pearl](https://forum.kirupa.com/u/black_pearl)\
**Post date:** [November 24, 2010, 11:05am UTC](https://forum.kirupa.com/t/lineto-drawing-a-single-line-using-animation/316524/1 "2010-11-24T11:05:20Z")

</div>

I am working on Drawing API. There is a movieclip on stage which I am animating using Tween class. I just want to draw a line from the initial position of a the movieclip to it’s final position. I can draw line, but I can see the lines being duplicated each time the enterframe runs. I just want a single line do be drawn from the movieclip’s initial position to it’s final position.

Here is my code

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;

var myTween:Tween = new Tween(circ0_mc, "_x", Strong.easeOut, circ0_mc._x, 0, 2, true);
var myTween:Tween = new Tween(circ0_mc, "_y", Strong.easeOut, circ0_mc._y, 300, 2, true);

_root.createEmptyMovieClip("circle",1);
this.onEnterFrame = function() {

    with (_root.circle) {
        lineStyle(4,0x0000FF,100);
        moveTo(20,20);
        lineTo(circ0_mc._x,circ0_mc._y);
    }
}

```
