Tooltip Class

Class com.blitzagency.xray.ui.Tooltip

Inheritance > Tooltip

A Customizable static class for generating and displaying Tooltips from anywhere in your code.
Must reside in a folder structure corresponding to the package: com.neoarchaic.ui. There are no assests for the library, since the tooltip is created and drawn dynamically.


The tooltip is created by invoking the static Tooltip class methods: Tooltip.show() and Tooltip.hide() (see method documentation for each method).


This tooltip supports html and will use CSS to style the text, if the html option is set to true. The passed toolitp text will then be automatically enclosed in a tag. The default value for the html option is false.

You can customize the tool both globally and locally.
Globally: Set options one at a time by using the static setOption () method.
To set multiple options in one go, set the public "options" property to an object containing one or more options (see example).
Locally: Pass an object with the options to the static Tooltip.show () method. In either case, only the options that have default values will be used, the rest will be ignored.

Examples:
import com.neoarchaic.ui.Tooltip;
Tooltip.options = {html: true, width: 300}
Tooltip.setOption("delay", 1)
Tooltip.show("Hi, I'm a tooltip. \nI can have multiple lines and I also wrap around")
Tooltip.show("Hi, I'm a delayed tooltip.", {delay: 2})
Tooltip.hide()


Author:
Karina Steffens
Neo-Archaic
www.neo-archaic.net
February 2005
Property Summary
 private static Object 
 static Object 
Use to change multiple default options globally
 private static Number 
 t
Method Summary
 private static Void 
 private static Void 
 doShow(tipText:String, options:Object)
 private static Void 
 drawRect(x, y, w, h, corner, bgColor, alpha)
 static Void 
 hide()
 static Void 
 setOption(optionName:String, optionValue:Object)
Use to change a single default option globally .
 static Void 
 show(tipText:String, options:Object)
Show the Tooltip after a delay
Example 1: (No options)
Tooltip.show ("Here is some example text for the static tooltip class");
Example 2: (One option)
Tooltip.show ("Here is some example text for the static tooltip class", {delay: 0});
Example 3: (Many options)
Tooltip.show ("Here is some example text for the static tooltip class", {delay:1, width:300, bgColor:0xFFFFFF, alpha:80, corner: 10, margiin:5, font: "Times New Roman", size: 14, color: 0x000099, bold:true, html:true});
Property Detail
__options
private static var __options:Object;
options
public static function get/set options():Object
Use to change multiple default options globally
Parameters:
options:Object
An object with the following optional properties:
options.delay:Number
delay in seconds (default: 0.5 second)
options.width:Number
maximum width of the tooltip window (default: 200px)
options.bgColor:Color
Background color of the tooltip (default: 0xFFFFDD - light yellow)
options.alpha:Number
Transparency of the tooltip (default: 85)
optoins.corner:Number
The diameter for the rounded corner (default: 5, for sharp corners pass 0)
options.margin:Number
(default: 2);
options.font:String
(default: "Verdana")
options.color:Color
Text and line color (default 0xFFFFFF)
options.size:Number
Font size (default: 10)
options.bold:Boolean
(default: false)
options.html:Boolean
(default: true)
t
private static var t:Number;
Method Detail
createTipClip
private static function createTipClip():Void
doShow
private static function doShow(tipText:String, options:Object):Void
drawRect
private static function drawRect(x, y, w, h, corner, bgColor, alpha):Void
hide
public static function hide():Void
Returns:
setOption
public static function setOption(optionName:String, optionValue:Object):Void
Use to change a single default option globally .
Parameters:
optionName
The property name of the option.
optionValue
The new value for the option.
show
public static function show(tipText:String, options:Object):Void
Show the Tooltip after a delay
Example 1: (No options)
Tooltip.show ("Here is some example text for the static tooltip class");
Example 2: (One option)
Tooltip.show ("Here is some example text for the static tooltip class", {delay: 0});
Example 3: (Many options)
Tooltip.show ("Here is some example text for the static tooltip class", {delay:1, width:300, bgColor:0xFFFFFF, alpha:80, corner: 10, margiin:5, font: "Times New Roman", size: 14, color: 0x000099, bold:true, html:true});
Parameters:
tipText
text to display
options
Use to temporarily override the default/global options



Documentation generated by BLDoc Community Edition from B-Line Express.