Christophe C Christophe C - 1 year ago 226
ActionScript Question

Avoid FocusOut event trigerred when apllication loses focus

I have done an override of the standard TextInput component

In this component I have :

addEventListener( FocusEvent.FOCUS_OUT, handleFocusOut );

  • My method is triggered when the field loses focus for another field (nice)

  • Problem : It is triggered also when the whole flex application loses focus (when my field has the current focus inside my form)

Questions :

  • What have I done wrong ?

  • Is there a way to avoid doing stuff when it is a application-focusout-event ?


Answer Source

I am not sure why this is behaving this way. But one solution might be to have an eventListener for FOCUS_OUT event at the application level and call stopImmediatePropagation().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download