public class ToolTipUtil {
/**
* 生成提示信息
*/
public static function _showTip($txt:String, txtInput:UIComponent):void {
if (_tip == null) {
var __point:Point = new Point(txtInput.x, txtInput.y);
__point = txtInput.localToGlobal(__point);
_tip = ToolTipManager.createToolTip($txt, __point.x - txtInput.x, __point.y - 40, 'errorTipAbove') as ToolTip;
_tip.styleName = 'testTip';
}
}
/**
* 销毁TIP
*/
public static function _destoryTip():void {
if (_tip) {
ToolTipManager.destroyToolTip(_tip);
}
_tip = null;
}
}
运行样式: