| Package | flare.vis.controls |
| Class | public class TooltipControl |
| Inheritance | TooltipControl Control flash.events.EventDispatcher |
flare.display.TextSprite instance is used to show a
tooltip. To change the tooltip text, clients can set either the
text or htmlText properties of this
TextSprite. For example:
// create a new tooltip control and set the text var ttc:TooltipControl = new TooltipControl(); TextSprite(ttc.tooltip).text = "The tooltip text";
Furthermore, this control fires events corresponding to tooltip show,
update (move), and hide events. Listeners can be added to dynamically
change the tooltip text when these events occur. Additionally, the
default text tooltip can be replaced with an arbitrary
DisplyObject to provide completely customized tooltips.
See also
| Property | Defined by | ||
|---|---|---|---|
| fadeDuration : Number = 0.3 Duration of fade animations (in seconds) for tooltip show and hide.
| TooltipControl | ||
![]() | filter : Function Boolean function indicating the items considered by the control.
| Control | |
| followMouse : Boolean = true Indicates if the tooltip should follow the mouse pointer.
| TooltipControl | ||
| hideDelay : Number The delay before hiding a tooltip, in milliseconds.
| TooltipControl | ||
![]() | object : InteractiveObject The interactive object this control is attached to.
| Control | |
| showDelay : Number The tooltip delay, in milliseconds.
| TooltipControl | ||
| tipBounds : Rectangle = null The legal bounds for the tooltip in stage coordinates.
| TooltipControl | ||
| tooltip : DisplayObject = null The display object presented as a tooltip.
| TooltipControl | ||
| xOffset : Number = 0 The x-offset from the mouse at which to place the tooltip.
| TooltipControl | ||
| yOffset : Number = 25 The y-offset from the mouse at which to place the tooltip.
| TooltipControl | ||
| Method | Defined by | ||
|---|---|---|---|
|
TooltipControl(filter:* = null, tooltip:DisplayObject = null, show:Function = null, update:Function = null, hide:Function = null, delay:Number = 500)
Creates a new TooltipControl.
| TooltipControl | ||
|
attach(obj:InteractiveObject):void
Attach this control to the given interactive object.
| TooltipControl | ||
|
[static]
Generates a default TextSprite tooltip
| TooltipControl | ||
|
detach():InteractiveObject
Detach this control.
| TooltipControl | ||
| Method | Defined by | ||
|---|---|---|---|
|
layout(tip:DisplayObject, obj:DisplayObject):void
Calculates the tooltip layout.
| TooltipControl | ||
| fadeDuration | property |
public var fadeDuration:Number = 0.3Duration of fade animations (in seconds) for tooltip show and hide. If less than or equal to zero, no fade will be performed.
| followMouse | property |
public var followMouse:Boolean = trueIndicates if the tooltip should follow the mouse pointer.
| hideDelay | property |
hideDelay:Number [read-write]The delay before hiding a tooltip, in milliseconds.
Implementation public function get hideDelay():Number
public function set hideDelay(value:Number):void
| showDelay | property |
showDelay:Number [read-write]The tooltip delay, in milliseconds.
Implementation public function get showDelay():Number
public function set showDelay(value:Number):void
| tipBounds | property |
public var tipBounds:Rectangle = nullThe legal bounds for the tooltip in stage coordinates. If null (the default), the full stage bounds are used.
| tooltip | property |
public var tooltip:DisplayObject = nullThe display object presented as a tooltip.
| xOffset | property |
public var xOffset:Number = 0The x-offset from the mouse at which to place the tooltip.
| yOffset | property |
public var yOffset:Number = 25The y-offset from the mouse at which to place the tooltip.
| TooltipControl | () | constructor |
public function TooltipControl(filter:* = null, tooltip:DisplayObject = null, show:Function = null, update:Function = null, hide:Function = null, delay:Number = 500)Creates a new TooltipControl.
Parametersfilter:* (default = null) — a Boolean-valued filter function indicating which
items should receive tooltip handling
|
|
tooltip:DisplayObject (default = null) |
|
show:Function (default = null) |
|
update:Function (default = null) |
|
hide:Function (default = null) |
|
delay:Number (default = 500) |
| attach | () | method |
public override function attach(obj:InteractiveObject):voidAttach this control to the given interactive object. This method will automatically detach if already attached to another object.
Parametersobj:InteractiveObject — the display object to attach to
|
| createDefaultTooltip | () | method |
public static function createDefaultTooltip():TextSpriteGenerates a default TextSprite tooltip
ReturnsTextSprite —
a new default tooltip object
|
| detach | () | method |
public override function detach():InteractiveObjectDetach this control.
ReturnsInteractiveObject — the interactive object this control was attached to,
or null if this control was not attached.
|
| layout | () | method |
protected function layout(tip:DisplayObject, obj:DisplayObject):voidCalculates the tooltip layout.
Parameterstip:DisplayObject — the tooltip object
|
|
obj:DisplayObject — the currently moused-over object
|
| hide | event |
| show | event |
| update | event |