# Struggling with Flash's Drawing API

**URL:** https://forum.kirupa.com/t/struggling-with-flashs-drawing-api/88097
**Category:** flash
**Created:** [April 26, 2005, 7:45pm UTC](https://forum.kirupa.com/t/struggling-with-flashs-drawing-api/88097 "2005-04-26T19:45:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)
#### Post date: [April 26, 2005, 7:45pm UTC](https://forum.kirupa.com/t/struggling-with-flashs-drawing-api/88097/1 "2005-04-26T19:45:48Z")

</div>

Hey guys…I just recently tried to get to grips with Flash’s Drawing API, so I could draw dynamically, which I always thought would be cool 🙂

Heh, but anyway, after reading Poms tute on it, I decided (as you do) to advance on what he covered, in this case it went wrong 😛 Using this code:

```auto
_root.createEmptyMovieClip("line",1);
line.lineStyle(2,0x000000,100);
line.moveTo(point1._x,point1._y);
_root.onEnterFrame = function () {
    line.lineTo(point2._x,point2._y);
    line.lineTo(point1._x,point1._y);
}

```

and two movieclips called point1, and point2, which are moving, I wanted a line to be between them continuously and thought the above code would work…WRONG!

This creates a line each frame and as the two mc’s move a new line is placed, albeit this made a fairly cool effect (kinda like a curve with straight lines) but it wasn’t the effect I was after, so I’m thinking I need to delete the previous line each frame, how would I go about doing this?
