×
Namespaces

Variants
Actions
Revision as of 23:55, 28 May 2007 by soueldi (Talk | contribs)

Archived:How to use a text input field in FlashLite

From Nokia Developer Wiki
Jump to: navigation, search


Compatibility: Flash Lite: 1.1, 2.x

Making a simple text field

  • 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.


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>);

Download

You can download an example with source code here:
Input Text 240*320 (swf + fla)

71 page views in the last 30 days.