Choose the proper tooltip position
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
verticalAlign="middle" horizontalAlign="center" height="250" width="400">
<mx:Script>
import mx.controls.ToolTip;
import mx.managers.ToolTipManager;
private var tip:ToolTip;
private function showTipA(event:Object):void {
tip = ToolTipManager.createToolTip("a",
event.currentTarget.x + event.currentTarget.width + 10,
event.currentTarget.y) as ToolTip;
}
private function showTipB(event:Object):void {
var pt:Point = new Point(event.currentTarget.x,event.currentTarget.y);
pt = event.currentTarget.contentToGlobal(pt);
tip = ToolTipManager.createToolTip("b",
pt.x + event.currentTarget.width + 10,
pt.y) as ToolTip;
}
private function destroyTip(event:Object):void {
ToolTipManager.destroyToolTip(tip);
}
</mx:Script>
<mx:TextInput id="a1" text="Good ToolTip placement" width="175" focusIn="showTipA(event)" focusOut="destroyTip(event)"/>
<mx:VBox >
<mx:TextInput id="b" text="Good ToolTip placement" width="175" focusIn="showTipB(event)" focusOut="destroyTip(event)" />
</mx:VBox>
</mx:Application>
Related examples in the same category