Ever wonder how to control the amount of time that a tool tip stays visible before disappearing? Well, wonder no more! You can control the length of time that a tool tip remains visible from the default 10 seconds to whatever you want by setting the ToolTipManager.hideDelay property. Simply set the value to however many milliseconds you want the tool tip to be visible for before disappearing and you’re set.
Full code after the jump.
The following example shows how to set the hide delay for a tool tip to 2 seconds (down from the default 10 seconds, or 10000 milliseconds), by setting the ToolTipManager.hideDelay property:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/07/23/setting-the-amount-of-time-that-a-tool-tip-is-visible-using-the-tooltipmanager-class/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.managers.ToolTipManager;
// milliseconds (default 10000)
ToolTipManager.hideDelay = 2500;
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Label text="Mouse over the Button below to see the tool tip." />
</mx:ApplicationControlBar>
<mx:Button id="button" label="click me"
toolTip="I'm a fabulous tool tip." />
<mx:Label text="The tool tip will disappear after {(ToolTipManager.hideDelay/1000).toFixed(1)} seconds." />
</mx:Application>
View source is enabled in the following example.





0 Responses to “Setting the amount of time that a tool tip is visible using the ToolTipManager class”
Leave a Reply