Tip of the day : SetInputTextType with Flash Lite 1.1

Posted in Development, Flash Lite, Mobile, Nokia, S60, tips on Sep 03, 2007

Tip of the dayFlash Lite 1.1 doesn’t support inline text input. For Nokia S60 devices, users have to navigate on to the input field and press Select button when focused. This activates native text input dialog, which is by default in “No Restriction” mode (you can enter any character you wish). However, that’s not very usable for some cases, and decreases user experience. For instance if you expect a numeric input from the user, it’s not reasonable to start the input dialog in generic mode. Instead, Adobe provides us a method via fscommand2 :

fscommand2(”SetInputTextType”, “Input1″, “Numeric”);

where, Input1 is the variable (”Var:”) name of the Input Field. This will start the dialog in numeric mode, so that users can start typing numbers right away.

However, this command won’t work anywhere else but root of the main movie. Therefore, if your input field is in a movie clip, just name your input field variable as “/:Input1″ and insert the variable and the fscommand2 code into a frame on root. It should look like this;

Input1;
fscommand2(”SetInputTextType”, “Input1″, “Numeric”);

Note: This is concerns only for Flash Lite 1.1 and Nokia S60 devices. Check out Jesse’s post to learn how the situation is with Flash Lite 2.x.

Trackback URI | Comments RSS

6 Responses to “ Tip of the day : SetInputTextType with Flash Lite 1.1 ”

  1. # 1 Matt Pollitt Says:

    Hi ugur,

    was looking at this and worked out you can set this from within the movieclip it’s self by using the tellTarget function. This makes it a bit more usable if you are dynamically loading MC’s containing different input text fields.

    ie.

    on the main timeLine, i have a MC called myMC. Inside this is a input text field. this text field refs the :/input var as in your example.

    on the timeline of myMc i put the following script on the main timeline in frame 1.

    tellTarget(”..”){
    input1 = 123
    fscommand2(”SetInputTextType”, “input1″, “Numeric”);
    }

    This way you can set it up and call it from within the mc it’s self, without any code on the main timeline at all.

    When run on device, this loads “123″ into the text field, and sets it to numeric entry.

    Matt

  2. # 2 Ugur Says:

    Hi Mark,

    Tried that technique, but couldn’t make it work. Can you send a sample?

    cheers,

    Ugur.-

  3. # 3 Kris Says:

    Sorry :(

  4. # 4 Paulos Says:

    Nice!

  5. # 5 Avery Says:

    This is exactly what I expected to find out after reading the title Getting your website crawled by Search engine Crawlers. Thanks for informative article.

  6. # 6 Charalampos Says:

    Cool.

Speak your peace!