Good evening all. I've got a movieclip which monitors and graphs the level of activity coming in, like a heart-rate monitor at the hospital. The graph scrolls the data off the screen, but the movieclip is never cleared, and the off-screen data builds up indefinitely. The longer the user stays on the page, the more memory the un-seen part of the graph takes.
What's the best way to clean up the unseen part of the movieclip?
The code is as follows:
this.stage.addEventListener(flash.events.Event.ENTER_FRAME,
function(event){
var dif = md.getDifferences();
meter.graphics.lineTo(xpos,dif);
meter.graphics.moveTo(xpos,dif);
if(xpos>WIDTH){
// once the graph exceeds the width of the clip, the graph scrolls off the screen
meter.x -= 1;
}
xpos ++;
}
);
This is how I'd do it:
Hope it helps. Rob