remove Focus
How to remove focus from InputText field?
I have a InputText field with the default value <Enter name>. When user clicks - he writes whatever he wants. After he presses enter the fiel should loose focus.. that is there should be no cursor blinking in that field.
Currently i have
TextListener = new Object();
TextListener.onSetFocus = function (oldFocus, currentFocus)
{
if (currentFocus._name == input_txt._name )
{
if (input_txt.text == "<Enter name>")
{
input_txt.text = "";
input_txt.textColor = 0x000000;
}
}
}
Selection.addListener(TextListener);
KeyListener = new Object();
KeyListener.onKeyUp = function ()
{
if (Key.getCode() == 13)
{
//the InputText field must loose focus
}
}
Key.addListener(KeyListener);
Can you help?
|