Umesh
Umesh

Reputation: 1242

In AIR how to set focus on textinput on application load?

On my application I have a login form. On application start, I want the focus/selected one is set on the user id textinput.

I tried normal setFocus method and didnt worked.

How can i make it work?

Upvotes: 1

Views: 995

Answers (1)

James Ward
James Ward

Reputation: 29433

This works for me with Flex 3 and AIR 1.5:

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">

  <mx:applicationComplete>
    ti.setFocus();
  </mx:applicationComplete>

  <mx:TextInput id="ti"/>

</mx:WindowedApplication>

Upvotes: 2

Related Questions