You Are Here:

Community: Wiki

This page was last modified on 14 September 2009, at 10:22.

How to make an input text field

From Forum Nokia Wiki

Reviewer Approved   

Compatibility: Flash Lite: 1.1, 2.x, 3.x

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).
    Image: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 .
    Image: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>);

Download

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


Further Reading

Creating Specialised TextFields

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fAccessingE5fsystemE5fresourcesE5fwithE5fPyS60E5fonE5fS60E5f3rdE5fE45ditionE5fdevicesX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtopicQUqfnTopicZflashE5fliteQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ