Flash Lite 2.x and 3.0 ActionScript Language Reference

GetBatteryLevel fscommand2 Command

GetBatteryLevel

Returns the current battery level. It is a numeric value that ranges from 0 to the maximum value returned by the GetMaxBatteryLevel variable.

Note: This command is not supported for BREW devices.

Command

Parameters

Value Returned

GetBatteryLevel

None.

-1: Not supported
Other numeric values: The current battery level.

Example

The following example sets the battLevel variable to the current level of the battery:

battLevel = fscommand2("GetBatteryLevel");