Categories: How To | Flash Lite | Code Examples | UI | Usability
This page was last modified 05:36, 24 April 2008.
How to make Flash Lite aware of softkey location and screen orientation
From Forum Nokia Wiki
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)
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
--Narender Raul
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| screen orientation | rkeskine | Symbian User Interface | 7 | 2007-10-04 12:07 |
| Detecting automatic screen switching | AcCarbon | Symbian User Interface | 8 | 2006-10-09 15:28 |
| Flash Lite 101, a new mobile technology | UbiquityGames | Mobile Java General | 0 | 2006-09-30 21:22 |
| AnimaLogic: Web Runtime game example | jappit | Widgets and Widsets | 7 | 2008-04-21 11:15 |
| S60 3rd Edition - IMEI retrival via Flash Lite | mikebrant | Flash Lite on Nokia Devices | 1 | 2008-03-05 23:55 |

