0; if(!visible){ removeEventListener(Event.ENTER_FRAME, onFrame); } } return visible; } private function onFrame(event: Event): void { if(!setVisibleThis()) return; var frameCount: int = 20; currFrame++; var frames: int = currFrame - lastFrame; if ((lastFrame < 0) || (frames >= frameCount)) { lastFrame = currFrame; var d: Date = new Date(); var currTick: int = d.valueOf(); var deltaTick: int = currTick - lastTick; actualFrameRate = frames / deltaTick * 1000; lastTick = currTick; updateTextInfo(); } } private function updateTextInfo(): void { text = actualFrameRate.toFixed(2) + ' fps :: ' + getMemoryUsage(); } ]]>