TextField gets FocusEvent type=“focusIn” even when its not true
-
03-07-2019 - |
Question
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.
Solution
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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow