views:

514

answers:

1

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.

+2  A: 

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

addEventListener(Event.ACTIVATE, handleActivate);

And when you loose the focus:

addEventListener(Event.DEACTIVATE, handleDeactivate);
grapefrukt