Flash Lite [20] 2.0 Button event

In the Flash Lite 2.0, we have to use different way to access the button event.

First, if you need to use the softkeys, you have to write down the code as below to enable it.
fscommand2(“SetSoftKeys”, “Left”, “Right”);

Then we need a KeyLinstener:Object to access the button event and define the behavior.

var keyListener:Object = new Object();
keyListener.onKeyUp = function() {
if (Key.getCode() == ExtendedKey.SOFT1) {
//Left Softkey
} else if (Key.getCode() == ExtendedKey.SOFT2) {
//Right Softky
} else if (Key.getCode() == Key.LEFT) {
} else if (Key.getCode() == Key.RIGHT) {
} else if (Key.getCode() == Key.UP) {
} else if (Key.getCode() == Key.DOWN) {
} else if (Key.getCode() == Key.ENTER) {
}
};
Key.addListener(keyListener);

If you would like to define the numeric keys(0-9), you need to use the Key.getAscii() start from 48 to 57.
use 43 to define the “*”
use 35 to define the “#”

[ Notice ] Don’t use getCode() for numeric keys, because the keyCode of 3=# and 8=*.

Reference: Get Key Code(Execute in your mobile phone or emulator in Flash 8

Advertisement

One Response to Flash Lite [20] 2.0 Button event

  1. flitetag says:

    Great information. For developer support go to this website. Upload you flash lite aps here. http://www.flashlitetag.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.