Packagecom.bit101.components
Classpublic class FPSMeter
InheritanceFPSMeter Inheritance Component Inheritance flash.display.Sprite



Public Properties
 PropertyDefined By
 Inheritedenabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  fps : int
[read-only] Returns the current calculated FPS.
FPSMeter
 Inheritedheight : Number
[override] Sets/gets the height of the component.
Component
  prefix : String
Sets or gets the prefix shown before the number.
FPSMeter
 Inheritedtag : int
Sets/gets in integer that can identify the component.
Component
 Inheritedwidth : Number
[override] Sets/gets the width of the component.
Component
 Inheritedx : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
 Inheritedy : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
 PropertyDefined By
 Inherited_enabled : Boolean = true
Component
  _fps : int = 0
FPSMeter
  _frames : int
FPSMeter
 Inherited_height : Number = 0
Component
  _label : Label
FPSMeter
  _prefix : String
FPSMeter
 InheritedRonda : Class
Component
  _startTime : int
FPSMeter
 Inherited_tag : int = -1
Component
 Inherited_width : Number = 0
Component
Public Methods
 MethodDefined By
  
FPSMeter(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, prefix:String = FPS:)
Constructor
FPSMeter
  
draw():void
[override]
FPSMeter
 Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
 Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
 Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
  
start():void
Starts the meter again if it has been stopped.
FPSMeter
  
stop():void
Stops the meter by removing the enterFrame listener.
FPSMeter
Protected Methods
 MethodDefined By
  
[override]
FPSMeter
 Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
 Inherited
init():void
Initilizes the component.
Component
 Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
  
onEnterFrame(event:Event):void
Internal enterFrame handler to measure fps and update label.
FPSMeter
 Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
  
onRemovedFromStage(event:Event):void
Stops the meter if it is removed from stage.
FPSMeter
Public Constants
 ConstantDefined By
 InheritedDRAW : String = draw
[static]
Component
Property Detail
_fpsproperty
protected var _fps:int = 0

_framesproperty 
protected var _frames:int

_labelproperty 
protected var _label:Label

_prefixproperty 
protected var _prefix:String

_startTimeproperty 
protected var _startTime:int

fpsproperty 
fps:int  [read-only]

Returns the current calculated FPS.


Implementation
    public function get fps():int
prefixproperty 
prefix:String

Sets or gets the prefix shown before the number. Defaults to "FPS:".


Implementation
    public function get prefix():String
    public function set prefix(value:String):void
Constructor Detail
FPSMeter()Constructor
public function FPSMeter(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, prefix:String = FPS:)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this ColorChooser.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
prefix:String (default = FPS:) — A string to put in front of the number value shown. Default is "FPS:".
Method Detail
addChildren()method
override protected function addChildren():void

draw()method 
override public function draw():void

onEnterFrame()method 
protected function onEnterFrame(event:Event):void

Internal enterFrame handler to measure fps and update label.

Parameters

event:Event

onRemovedFromStage()method 
protected function onRemovedFromStage(event:Event):void

Stops the meter if it is removed from stage.

Parameters

event:Event

start()method 
public function start():void

Starts the meter again if it has been stopped.

stop()method 
public function stop():void

Stops the meter by removing the enterFrame listener.