Hey all,
I have a class that serves as a debugger - containing a textfield that text
gets dumped into. Rather quickly. What might be the best way to simply limit
the number of lines in the field itself, as the appends after a while bog
the application down (understandable).
I have many ideas, but
I do something like this, It can be optimized, Im moving all logs every
time when you can have something like a ringbuffer instead:
private var _log:Array = new Array(20);
public function log(t:*)
{
for (var i:int = 0; i _log.length-1; i++) {
// update window after 1s without receiving data or case buffer
exceds 100 chars
function log(str) {
buffer += str + chr(10);
if (buffer.length 100) {
checkChange();
} else {
clearInterval(intervalCheckChange);
3 matches
Mail list logo