Packagestarling.utils
Classpublic class SystemUtil
InheritanceSystemUtil Inheritance Object

A utility class with methods related to the current platform and runtime.



Public Properties
 PropertyDefined By
  isAIR : Boolean
[static] [read-only] Indicates if the code is executed in an Adobe AIR runtime (true) or Flash plugin/projector (false).
SystemUtil
  isApplicationActive : Boolean
[static] [read-only] Indicates if the application is currently active.
SystemUtil
  isDesktop : Boolean
[static] [read-only] Indicates if the code is executed on a Desktop computer with Windows, OS X or Linux operating system.
SystemUtil
  platform : String
[static] [read-only] Returns the three-letter platform string of the current system.
SystemUtil
  supportsDepthAndStencil : Boolean
[static] [read-only] Returns the value of the 'initialWindow.depthAndStencil' node of the application descriptor, if this in an AIR app; otherwise always true.
SystemUtil
  supportsVideoTexture : Boolean
[static] [read-only] Indicates if Context3D supports video textures.
SystemUtil
  version : String
[static] [read-only] Returns the Flash Player/AIR version string.
SystemUtil
Public Methods
 MethodDefined By
  
executeWhenApplicationIsActive(call:Function, ... args):void
[static] Executes the given function with its arguments the next time the application is active.
SystemUtil
  
initialize():void
[static] Initializes the ACTIVATE/DEACTIVATE event handlers on the native application.
SystemUtil
  
isEmbeddedFont(fontName:String, bold:Boolean = false, italic:Boolean = false, fontType:String = embedded):Boolean
[static] Figures out if an embedded font with the specified style is available.
SystemUtil
  
[static] Updates the list of embedded fonts.
SystemUtil
Property Detail
isAIRproperty
isAIR:Boolean  [read-only]

Indicates if the code is executed in an Adobe AIR runtime (true) or Flash plugin/projector (false).


Implementation
    public static function get isAIR():Boolean
isApplicationActiveproperty 
isApplicationActive:Boolean  [read-only]

Indicates if the application is currently active. On Desktop, this means that it has the focus; on mobile, that it is in the foreground. In the Flash Plugin, always returns true.


Implementation
    public static function get isApplicationActive():Boolean
isDesktopproperty 
isDesktop:Boolean  [read-only]

Indicates if the code is executed on a Desktop computer with Windows, OS X or Linux operating system. If the method returns 'false', it's probably a mobile device or a Smart TV.


Implementation
    public static function get isDesktop():Boolean
platformproperty 
platform:String  [read-only]

Returns the three-letter platform string of the current system. These are the most common platforms: WIN, MAC, LNX, IOS, AND, QNX. Except for the last one, which indicates "Blackberry", all should be self-explanatory.


Implementation
    public static function get platform():String
supportsDepthAndStencilproperty 
supportsDepthAndStencil:Boolean  [read-only]

Returns the value of the 'initialWindow.depthAndStencil' node of the application descriptor, if this in an AIR app; otherwise always true.


Implementation
    public static function get supportsDepthAndStencil():Boolean
supportsVideoTextureproperty 
supportsVideoTexture:Boolean  [read-only]

Indicates if Context3D supports video textures. At the time of this writing, video textures are only supported on Windows, OS X and iOS, and only in AIR applications (not the Flash Player).


Implementation
    public static function get supportsVideoTexture():Boolean
versionproperty 
version:String  [read-only]

Returns the Flash Player/AIR version string. The format of the version number is: majorVersion,minorVersion,buildNumber,internalBuildNumber.


Implementation
    public static function get version():String
Method Detail
executeWhenApplicationIsActive()method
public static function executeWhenApplicationIsActive(call:Function, ... args):void

Executes the given function with its arguments the next time the application is active. (If it is active already, the call will be executed right away.)

Parameters

call:Function
 
... args

initialize()method 
public static function initialize():void

Initializes the ACTIVATE/DEACTIVATE event handlers on the native application. This method is automatically called by the Starling constructor.

isEmbeddedFont()method 
public static function isEmbeddedFont(fontName:String, bold:Boolean = false, italic:Boolean = false, fontType:String = embedded):Boolean

Figures out if an embedded font with the specified style is available. The fonts are enumerated only once; if you load a font at runtime, be sure to call 'updateEmbeddedFonts' before calling this method.

Parameters

fontName:String — the name of the font
 
bold:Boolean (default = false) — indicates if the font has a bold style
 
italic:Boolean (default = false) — indicates if the font has an italic style
 
fontType:String (default = embedded) — the type of the font (one of the constants defined in the FontType class)

Returns
Boolean
updateEmbeddedFonts()method 
public static function updateEmbeddedFonts():void

Updates the list of embedded fonts. To be called when a font is loaded at runtime.