Archived:How to make Flash Lite aware of softkey location and screen orientation
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.
We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.
Article Metadata
Code Example
Source file: Media:Softkey location.zip
Article
Created: sellis
(20 Feb 2007)
Last edited: hamishwillee
(14 May 2013)
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:
Author
--Narender Raul



If you are developing the applications for devices supporting the change in orientation, the application must change the graphics and the user interaction points. The article is useful in getting the device orientation and apply the skin changes and also the soft-key location. The artcile very well details the location of soft keys depending upon the value retruned by fscommand2("GetSoftKeyLocation").