| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
ToolTip |
|
|
| Property | Defined By |
|---|---|
| All inherited properties of the RegTextField class. | N/A |
| Method | Defined By |
|---|---|
|
ToolTip(_haveBg:Boolean=false, bgColor1:uint=0xFFFFFF, bgColor2:uint=0xFFFFFF, _lineColor:uint=0x000000)
Creates a new instance of the ToolTip class. |
ToolTip |
|
startToolTip(label:String, target:Object, importImage:String=null, _x:int=0, _y:int=0, _width:int=0, _height:int=0, showAlways:Boolean=false):void
Initiates creating a tooltip. |
ToolTip |
| Event | Defined By |
|---|---|
| All inherited events for the RegTextField class. |
| Constructor Detail |
|---|
|
ToolTip () Constructor
public function ToolTip(_haveBg:Boolean=false, bgColor1:uint=0xFFFFFF, bgColor2:uint=0xFFFFFF, _lineColor:uint=0x000000) |
| Intializes a new ToolTip instance. |
Parameters
|
| Method Detail |
|---|
|
startToolTip ():void method
This method will initiate the creation of the tooltip. |
Parameters
|
| Examples |
|---|
Create a new fla file and name it Tooltip.fla. Place the fla in the same folder as the biz folder. Create an area, make it a
MovieClip
and call it 'ToolTip'. Export for actionscript and add the class path
biz.flashscript.text.ToolTip
Place two
MovieClips
or
Sprites
on the stage and name them "myClip1" and "myClip2". Have an image ready with the name "img.jpg" in a folder named "images" with a width of 250 and height of 250. Then create an Actionscript file, name it Tooltip.as and place this script. The tooltip will only show up when the mouse moves over one of the objects.
package
{
import flash.display.Sprite;
import biz.flashscript.text.ToolTip;
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class Tooltip extends Sprite
{
private var tt:ToolTip;
public var myClip1:MovieClip;
public var myClip2:MovieClip;
public var fc:MovieClip;
public function Tooltip ():void
{
tt = new ToolTip(true,0xFFFF00,0xFFFFFF,0x0071BC);
addChild (tt);
tt.alpha = 0;
myClip1.addEventListener (MouseEvent.ROLL_OVER,rov1);
myClip2.addEventListener (MouseEvent.ROLL_OVER,rov2);
}
private function rov1 (event:MouseEvent):void
{
tt.startToolTip ("This shows text. Now move over the other button.",myClip1);
}
private function rov2 (event:MouseEvent):void
{
tt.startToolTip ("Model",myClip2,"images/img.jpg", 50, 350, 220, 220);
}
}
}
|