Tip of the day : SetInputTextType with Flash Lite 1.1
Flash 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.
September 10th, 2007 at 1:56
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
October 2nd, 2007 at 13:42
Hi Mark,
Tried that technique, but couldn’t make it work. Can you send a sample?
cheers,
Ugur.-
November 6th, 2007 at 2:21
Sorry :(
January 11th, 2008 at 16:20
Nice!
January 13th, 2008 at 10:37
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.
February 2nd, 2008 at 10:43
Cool.