Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:How to use a text input field in FlashLite

From Wiki
Jump to: navigation, search

Archived.pngArchived: 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.

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
Platform(s): Flash Lite: 1.1, 2.x, 3.x
Created: soueldi (28 May 2007)
Last edited: hamishwillee (14 May 2013)

Input example.jpg


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).
    Input prop.jpg
  • 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 .
    Input focus.jpg
  • 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>);

Further Reading

Creating Specialised TextFields

This page was last modified on 14 May 2013, at 03:12.
76 page views in the last 30 days.