Tom
Tom

Reputation: 6707

TextField gets FocusEvent type="focusIn" even when its not true

It seems that my TextField() gets "FocusEvent type=focusIn" even when there is no real keyboard focus (cursor not blinking)
I am calling "stage.focus = mytextfield;" in main constructor and it seem to cause it:

However, there is no focus in the whole flash application yet unless I click the flash area, focusIN event appears while the focus remains on the webpage.

How can I know when a real keyboard focus is received by textfield(), e.g. when cursor starts blinking? Is it another event type? any workarounds?

I need to know when FOCUS is received OK.

Upvotes: 2

Views: 929

Answers (1)

grapefrukt
grapefrukt

Reputation: 27045

You will also need to listen for focus on the application as a whole:

addEventListener(Event.ACTIVATE, handleActivate);

And when you lose the focus:

addEventListener(Event.DEACTIVATE, handleDeactivate);

Upvotes: 2

Related Questions