<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete()" frameRate="99" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ private var fps : uint; private var timer : Timer; private function onCreationComplete() : void { timer = new Timer(1000); timer.addEventListener( TimerEvent.TIMER, onTimerEvent ); timer.start(); fps = 0; this.addEventListener(Event.ENTER_FRAME, onFrameEnter); } private function onFrameEnter( event : Event ) : void { fps++; trace("enterframe"); } private function onTimerEvent( event : Event ) : void { fpsText.text = fps.toString(); fps=0; } ]]> </mx:Script> <mx:Label x="10" y="10" text="fps:"/> <mx:TextInput x="45" y="8" width="123" id="fpsText" editable="false"/> </mx:Application>