TextInput, RichEditableText, NumericStepper等类型的控件在获得焦点后.
有时需要他失去焦点时stage.focus=null;不能完全做到,因为focusmanager里还保存着个lastFocus,程序再次激活时会自动把它重新设置为焦点.
解决方法:
use namespace mx_internal;
focusManager.mx_internal::lastFocus = null;
示例:
protected function mouseFocusChangeHandler(event:FocusEvent):void
{
if(stage && stage.focus && focusManager
&& focusManager.mx_internal::lastFocus
== )
{
stage.focus=null;
focusManager.mx_internal::lastFocus
= null;
}
}
<s:TextInput mouseFocusChange="mouseFocusChangeHandler(event)"/>
Flex 文本编辑类控件 强制失去焦点问题,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/tary-hit/p/3756671.html