×
Namespaces

Variants
Actions
Revision as of 09:55, 26 July 2012 by hamishwillee (Talk | contribs)

Archived:How to make Flash Lite aware of softkey location and screen orientation

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code ExampleArticle
Created: sellis (20 Feb 2007)
Last edited: hamishwillee (26 Jul 2012)

Flash Lite 1.1

Contents

How to make Flash Lite aware of softkey location and screen orientation

Nokia devices support multiple screen orientation. Some devices provide dedicated softkey for each screen orientation.(like N93, N95)

Nokia 93 Screen Orientation

Mobile devices where the screen orientation and softkey location can be easily changed.


Create flashlite 1.1 game or application, where the screen orientation and softkey location can be changed.

  • How to get the current location of the softkeys relocate to the X and y axis of the screen.

Obtaining the current softkey location

The fscommand2("GetSoftKeyLocation") command to obtain the current softkey location. Add key listener

// The screen orientation has changed by give an Insert key event.
On(KeyPress"<Insert>")
{
//Define a variable
lc=fscommand2("GetSoftKeyLocation")
}

The lc contains a value that represents the location of the softkey as follows:

  • 0 The softkeys are located on the top of the device screen.
  • 1 The softkeys are located on the left of the device screen.
  • 2 The softkeys are located on the bottom of the device screen.
  • 3 The softkeys are located on the right of the device screen.
  • Here, Represent the softkey are located on the bottom of the device screen and softkeys are located on the right of the device screen.
  • 2 represent the bottom and 3 represent the right softkey location.
  • Create a movie clip back text and give it a name txt_function.
  • Fist frame is bottom location text and give it a frame name bottom.
  • Second frame is right location set text according to the softkey and give it a frame name right

Add this code

// The screen orientation has changed by give an Insert key event.
On(keyPress"<Insert>")
{
//Define a variable
lc=fscommand2("GetSoftKeyLocation")
}
//when the device screen orientation changed the softkey location also changed.
if(lc==2){
tellTarget("txt_function"){
call("bottom")
}
} else if (lc==3){
tellTarget("txt_function"){
call("right")
}
}

Command support on real device, not support in test device emulator. (like N93, N95)

Download

you can download an example with source code here:

softkey location

Author

--Narender Raul

118 page views in the last 30 days.
×