# Limit to length of lineTo?

**URL:** <https://forum.kirupa.com/t/limit-to-length-of-lineto/260214>\
**Category:** flash\
**Created:** [May 13, 2008, 3:28pm UTC](https://forum.kirupa.com/t/limit-to-length-of-lineto/260214 "2008-05-13T15:28:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhob](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@bhob](https://forum.kirupa.com/u/bhob)\
**Post date:** [May 13, 2008, 3:28pm UTC](https://forum.kirupa.com/t/limit-to-length-of-lineto/260214/1 "2008-05-13T15:28:41Z")

</div>

The following is on an enterframe event:

```auto
function drawLine(event:Event):void {
    rootNode.x -= 5;
    myLine.graphics.lineTo(lnX +=5,lnY-=adjY);
}

```

…where myLine is contained in rootNode… the line is drawn to the right and rootnode is moved left… In essence… it looks like a stock ticker or heart rate monitor.

An example image:

And a swf example:

My question is… do I need to clean up the drawing after it scrolls off screen to left or can I just keep drawing the line forever and ever. How does CS3 handle lines drawn. Will the app eventually die because the line gets too big? It could be running for several hours or longer.

I read a post by sinocular that said lines don’t get cleaned up in the lineTo method.

Any help would be appreciated
