Game Development Reference
In-Depth Information
private function profileCalculate():void : Once the profiling is complete, we must
calculate the average frame rate, making sure to use the actual number of frame rate
events. We then call dispose and dispatch an event that Main will listen for so it can
jump to the next framework state.
profilerFrameRateAverage = profilerFrameRateTotal / profilerFrameRateEventCounter;
dispose();
dispatchEvent(new Event(EVENT_COMPLETE));
private function profileAddObject():void : This function adds objects for profiling. It
is only used internally by the profile system.
private function profileUpdate():void : This internal function is used in profiling the
system. This updates the positions of the profile objects.
private function profileRender():void : This blits the profile objects to the canvas
when profiling is running.
public function dispose():void : This is used to dispose of objects used in profiling to
free up memory.
Figure 11-2. The render profiler in action
Search WWH ::




Custom Search