Code:
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.
My question is… how do I clean up the drawing after it scrolls off screen to left or can I just keep drawing the line forever and ever. Would I have to use clear and store points in an array? Any other ways to do this?
I’m assuming the app will eventually die because the line gets too big? It could be running for several hours or longer. It does get choppy after about 20 minutes.
Once the line reaches the right edge of the page, draw() the line to a bitmapData object, and begin to move the bitmap and the line’s origin to the left while drawing. Once the line’s origin has moved to the left edge, repeat the process. Something like this: