Archived:Introduction to fscommands
Historically, the fscommand function was introduced for Flash Player 3 to enable the Flash movie to to communicate with the Flash Player, or application hosting the Flash Player. The fscommand function was also used to to pass messages to Macromedia Director, or to Visual Basic, Visual C++, and other programs hosting ActiveX controls. Most of the original fscommand actions are not supported in Flash Lite, with the exception of "launch".
The fscommand2 function was introduced in Flash Lite 1.1 to support interaction with mobile devices capabilities such as locale data, date and time, network and battery level, operating system version and the IMEI code of the device. It can also be used to give feedback to the user through vibration. This article will concentrate on the fscommand2.
status = fscommand("Launch", "application-path, arg1, arg2,..., argn")
returnValue = fscommand2(command [, expression1 ... expressionN])
Differences between fscommand and fscommand2
The main purpose of the two functions is the same, the interaction between the host system and the Flash movie, but there are two main differences:
execution point in time
- fscommand() is run at the end of the current frame
- in Flash Lite, fscommand2() is executed immediately
- fscommand() is always void and does not return a value
- fscommand2() returns failure, succes or a specific return value
List of supported fscommand2() actions
The following is a list of fscommand2() actions supported in Nokia ans s60 handsets in general. You can find more information of each command from Adobe.
The Adobe site is more general Flash Lite, some of the commands are links to Nokia device specific code examples:
Device information commands
- Maximum network signal level
- Current signal level
- The name of the active network
- Connection status
- 2g 3g etc.
- Name of the current network
- Status of the most recent HTTP request
- Home network or roaming
- Returns the device's battery level
- Returns the device's maximum battery level
- Charging or on battery
- series 40, s60, etc.
- Returns a device identifier
- IMEI code
- Maximum heap memory size
- Heap memory size available
- The device's maximum volume level
- Current volume level
- The locale ID
- Long date format of current locale
- Current weekday
- Current time
Using device capabilities
- Extends the on time of the backlight
- Forces the application to fullscreen mode
- Starts vibration
- Stops vibration
- Color of the focus rectangle
- Alpha, numeric, etc.
- Remaps device's softkeys
- Resets softkeys to default
- Causes the Flash Lite Player to stop playback and exit
There are individual differences between handsets and Flash Lite versions. The best place to check is Adobe Device Central