Here is a functional example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function go():void{
Alert.show("The focus will return to txtOne. Look: ");
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextInput id="txtOne" text="1" focusOut="go()"/>
<mx:TextInput id="txtTwo" text="2"/>
</mx:VBox>
</mx:Application>
When you change from txtOne to txtTwo, the Alert is showed and after pressing OK, the focus will return to txtOne. I don't want that to happen. How to solve this?
Alert.show
has close callback argument, so you will know, when it is closed and set focus to something else. Update: you should have flag, indicating, that focus out event can be processed: