Tooltip for error message
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="20">
<mx:Style>
.errorTip {
color: #FFFFFF;
fontSize: 9;
fontWeight: "bold";
shadowColor: #000000;
borderColor: #FF0000;
borderStyle: "errorTipRight";
paddingBottom: 4;
paddingLeft: 4;
paddingRight: 4;
paddingTop: 4;
}
</mx:Style>
<mx:Script>
import mx.controls.ToolTip;
import mx.managers.ToolTipManager;
private var errorTip:ToolTip;
private var myError:String;
private function validateEntry(type:String, event:Object):void {
errorTip =ToolTipManager.createToolTip("Error",event.currentTarget.x +event.currentTarget.width,event.currentTarget.y) as ToolTip;
errorTip.setStyle("styleName", "errorTip");
}
</mx:Script>
<mx:TextInput id="aa" text="press enter in the following text field to see error tooltip"/>
<mx:TextInput id="phone" enter="validateEntry('phone',event)"/>
</mx:Application>
Related examples in the same category