Search code examples
iosairfocusflash-buildersoft-keyboard

How to keep soft keyboard opened on iOS. Flash Builder 4


I'm building chat application for mobile devices with Adobe Flash Builder 4.6. I have s:TextInput for message entering and s:Button for sending message. When user enters message and taps "Send" keyboard goes down. I want to keep it opened.

I can use textInput.setFocus() and setFocus with setTimeout(), but it gives unexpected results sometimes. For example soft keyboard can jump or goes down without resizing stage.

Could you recommend good solution for keeping soft keyboard opened when taping outside text input (focus should left in text input).


Solution

  • What worked for me was:

    • Create a listener for the TextInput focus out event
    • Put textInput.setFocus() code in that listener handler

    When I want the textInput to be able to focus out for specific cases I create a lockFocus variable for the listener to check first before deciding to reassign focus or not.

    Hope that helps!