Flash Lite 2.x and 3 Help

Using the soft keys

To use the soft keys in your Flash Lite application, you must first call the SetSoftKeys command. Subsequently, Flash Lite generates an ExtendedKey.SOFT1 event when the user presses the left soft key and an ExtendedKey.SOFT2 event when the user presses the right soft key. You write ActionScript event handler code that responds to these events and takes the desired action.

The SetSoftKeys command takes two parameters that specify the labels for the left and right soft keys, respectively, that appear when your application is not running in full-screen mode. For applications running in full-screen mode, the labels that you specify are not visible, so you must create your own labels and position them on the Stage where the soft keys are located.

For example, consider the following SetSoftKeys command call:

fscommand2("SetSoftKeys", "Options", "Exit");

The following example shows the result of using this command in an application running on an actual device in normal (not full-screen) mode:

If you enable full-screen mode--that is, if you call fscommand("fullscreen", true)--the labels that you specify as parameters to the SetSoftKeys command are not visible. Consequently, in full-screen mode applications, you must create your own soft key labels, as shown in the following example:

For more information about the SetSoftKeys command, see the fscommand2 function entry in the Flash Lite 2.x ActionScript Language Reference.

 

Send me an e-mail when comments are added to this page | Comment Report