# Clear() function

**URL:** <https://forum.kirupa.com/t/clear-function/212807>\
**Category:** Uncategorized\
**Created:** [January 14, 2007, 4:25pm UTC](https://forum.kirupa.com/t/clear-function/212807 "2007-01-14T16:25:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario\_hater](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mario\_hater](https://forum.kirupa.com/u/mario_hater)\
**Post date:** [January 14, 2007, 4:25pm UTC](https://forum.kirupa.com/t/clear-function/212807/1 "2007-01-14T16:25:01Z")

</div>

im trying to draw a line to a ball that i create but it just keeps making new lines. I though i saw a way to stop that putting a clear() in. this is my code

```auto
lineStyle(1);
attachMovie("ball", "ball", 0);
onEnterFrame = function () {
    moveTo(ball._x, ball._y);
    lineTo(_xmouse, _ymouse);
};

```
