Hi All
I was after a bit of advice on how to go about creating tooltips.
I have thumbnails of different colours. When the user hovers over the thumbnail I want a tooltip to appear with the name of the colour.
What is the best way to do this? I got the tooltip working - Just need a bit of guidance on the content of the tooltip!
This is my code so far but not sure how to go about creating multiple tooltips:
Code:
btn1.addEventListener("mouseOver", mouse_RollOver);
btn1.addEventListener("mouseOut", mouse_RollOut);
btn1.addEventListener("mouseMove", mouse_Move);
var tooltip:Tooltip = new Tooltip();
tooltip.txt.text="This is a tooltip";
tooltip.x=stage.mouseX;
tooltip.y=stage.mouseY-btn1.height;
function mouse_RollOver(e:MouseEvent):void {
addChild(tooltip);
var myTween:Tween=new Tween(tooltip,"alpha",Regular.easeIn,0,1,0.6,true);
}
function mouse_RollOut(e:MouseEvent):void {
removeChild(tooltip);
}
function mouse_Move(e:MouseEvent):void {
tooltip.x=stage.mouseX;
tooltip.y=stage.mouseY-btn1.height;
}
I don't want to repeat this code over and over for each button as there are quite a lot of thumbnails - I'd appreciate any advice or help on this...
thanks