AS2:
txt.onSetFocus = function ()
{
//当得到focus(聚集)时调用。
};
txt.onKillFocus = function ()
{
//当失去focus(聚集)时调用。
};
AS3:
dispatcher.addEventListener(FocusEvent.FOCUS_IN, focusInHandler);//得到
dispatcher.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);//失去
dispatcher.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
dispatcher.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);