Christophe C Christophe C - 4 months ago 15
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 ?



Regards

Answer

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().

Comments