Skip to main content
Participant
July 15, 2011
Question

iOS input text field focus problem in Air 2.7

  • July 15, 2011
  • 1 reply
  • 3027 views

Hi all,

I'm having a problem trying to give focus to a text field in air for iOS 2.7.

What I'm trying to do is as soon as the app loads, to give this input textfield mouse focus so that the user can start typing with the keyboard right away. In 2.6 I was able to set focus no problem using the code below, but since I've started using the 2.7 deployer, it doesn't set focus properly anymore.

I'm using a classic text field set to type inputText.

var focus:FocusManager = new FocusManager(this);

textField.stage.focus=textField; ////the text field is called textField

Any ideas?

Thanks!

Liam

This topic has been closed for replies.

1 reply

Participating Frequently
July 20, 2011

Hi,

Thanks for reporting this issue. There has been a design change in AIR 2.7, and that is why you are seeing this new behavior. You could call requestSoftKeyboard() to achieve the same. See http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display/InteractiveObject.html#requestSoftKeyboard().

Thanks,

Sanika

Known Participant
January 4, 2012

Hey!

thanks for the reply, though that doesn't solve the problem.

"Note: This method is not supported in AIR applications on iOS."

I am building an app for iOS, and i want the keyboard right away when the object is created.... any clue on how to achieve this ?

Thanks!

Rares.

------------SOLVED

http://blogs.adobe.com/cantrell/archives/2011/09/native-text-input-with-stagetext.html

i used the nativetext class + the assignFocus property.