Packagecom.gskinner.utils
Classpublic class FramerateThrottler

Simple class designed to throttle the framerate of AIR applications when they are not the active (frontmost) application. This is to reduce problems with idle CPU usage on Mac. This should be initialized as soon as your application starts up and has a window open.



Public Properties
 PropertyDefined by
  active : Boolean
[static][read-only] Indicates whether your application is currently active (frontmost).
FramerateThrottler
  enabled : Boolean
[static]
FramerateThrottler
  onlyThrottleOnMac : Boolean = false
[static] Specifies whether to only throttle framerate on the Mac.
FramerateThrottler
Public Methods
 MethodDefined by
  
initialize(backgroundFramerate:Number = 1, activeFramerate:Number):void
[static] Initializes the system.
FramerateThrottler
Property detail
activeproperty
active:Boolean  [read-only]

Indicates whether your application is currently active (frontmost).

Implementation
    public static function get active():Boolean
enabledproperty 
enabled:Boolean  [read-write]Implementation
    public static function get enabled():Boolean
    public function set enabled(value:Boolean):void
onlyThrottleOnMacproperty 
public static var onlyThrottleOnMac:Boolean = false

Specifies whether to only throttle framerate on the Mac.

Method detail
initialize()method
public static function initialize(backgroundFramerate:Number = 1, activeFramerate:Number):void

Initializes the system. This should be called as soon as your application starts up and has a window open.

Parameters
backgroundFramerate:Number (default = 1) — Specifies the framerate to use when your application is not active (ie. in the background).
 
activeFramerate:Number — Optional parameter specifying your application's default framerate. If you omit this parameter, it will use the current framerate of your application or 20fps if there is no window open to read the framerate from.