Archived:How to use a text input field in FlashLite
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.
This article shows how to create an input text-field in a FlashLite application. It also briefly mentions the limitations of text-field in FlashLite 2 and suggests approaches for using inline text entry in FlashLite3.
Article Metadata
Compatibility
Article
Contents |
Making a simple text field
FlashLite 2
- Using the Text tool, drag a text field.
- In Properties tab, select Input Text and fill the Var field to link it to a variable. (myText in this example).
- To edit a text field, users must first give an input text field focus, and then press their device's select key. By default, a yellow rectangle will be drawn around the input text field that has focus .
- When a user edit a text field, the linked variable (myText here) will contain this value.
FlashLite 2.1 and 3.x
Limitation of Input TextField in Flash Lite 2.0
- Flash Lite 2.0 does not support inline text input.
- When user has to enter in textfield, user is prompted with a Modal Dialog Box which appears over the FlashLite application.
- Before entering in the textfield, user must set the focus to textfield and also activate it using the device Select key.
- Flash Lite 2.0 does not have the ability to set text selections.
Using Inline TextField in Flash Lite 2.1 and 3.x
Using inline text-field user can edit the textfield directly in the FlashLite application rather than in seperate model input box. In case of inline text input Flash Lite player does not process the user input directly but devices native input method editor is used. When the inline text field is active, Flash Lite player can not execute any instruction as Flash Lite player runs in restricted mode. Only after the text field is deactivated, Flash Lite player runs in norml mode.
When the user is entering text in the input field, Flash Lite player uses Input Mode Indicator to indicate if it is alpha input(Indicated by letter 'A') or numeric input(Indicated by sign '#').
After user sets focus to input text-field, it is not necessary for user to press the devices Select key in case the application contains following text field activation code.
var objFocusListener:Object = new Object ();
objFocusListener.onSetFocus = function (oldFocus, newFocus) {
fscommand ("activateTextField", "");
};
TextFieldInstanceName.addListener (objFocusListener);
Custom input text
- Numerical input field
You can make an input text field allowing numbers only by executing this code:
fscommand2("SetInputTextType", "myText", "Numeric");
- Set maximum characters allowed
Select you text field, then fill the Maximum characters in the Properties tab.
- Sets the color of the focus rectangle (Flash Lite 2.x only)
You can change the color of the focus rectangle (yellow by default) by using the following statement:
fscommand2("SetFocusRectColor", 255, 153, 0); //Orange
To reset the color of the focus rectangle:
fscommand2("SetFocusRectColor", <red>, <green>, <blue>);



Good article describing the use of input text-field in FlashLite.
The article is recommnded to beginers to learn on using input text-fields in FlashLite applications. The author has very well explained the procedurae to create the input text-field with the help of high-lighted images. It also mentions the limitations of text-field in FlashLite 2 and suggest the approaches of using inline text entry in FlashLite3.
The information about setting the focus color is also useful.