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
  isAndroid : Boolean
[static] [read-only] Indicates if the code is executed on an Android device, based on the platform string.
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, macOS or Linux operating system.
SystemUtil
  isIOS : Boolean
[static] [read-only] Indicates if the code is executed on an iOS device, based on the platform string.
SystemUtil
  isMac : Boolean
[static] [read-only] Indicates if the code is executed on a Macintosh, based on the platform string.
SystemUtil
  isWindows : Boolean
[static] [read-only] Indicates if the code is executed on Windows, based on the platform string.
SystemUtil
  platform : String
[static] 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 the current platform and runtime support 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
isAndroidproperty 
isAndroid:Boolean  [read-only]

Indicates if the code is executed on an Android device, based on the platform string.


Implementation
    public static function get isAndroid():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, macOS 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
isIOSproperty 
isIOS:Boolean  [read-only]

Indicates if the code is executed on an iOS device, based on the platform string.


Implementation
    public static function get isIOS():Boolean
isMacproperty 
isMac:Boolean  [read-only]

Indicates if the code is executed on a Macintosh, based on the platform string.


Implementation
    public static function get isMac():Boolean
isWindowsproperty 
isWindows:Boolean  [read-only]

Indicates if the code is executed on Windows, based on the platform string.


Implementation
    public static function get isWindows():Boolean
platformproperty 
platform:String

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.

For debugging purposes, you can also assign a custom value.


Implementation
    public static function get platform():String
    public static function set platform(value:String):void
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 the current platform and runtime support video textures.


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.