5/10/2010 6:44:48 AM
Title:
Gradient in Tooltip
Hi all, I want to add gradient in default tooltip of flex, any Suggestions or Source Code?
Thanks in Advance..
5/10/2010 7:06:35 AM
you need to extend the tootltip class there is no inbuilt functionality like this in tooltip for flex.
5/10/2010 11:28:35 AM
you can use the following class to create a custom tooltip. This class uses gradient fill, however you can customize it to create your own gradient effect. To use this custom class of tooltip in your application set the toolTipClass in your main mxml file;
ToolTipManager.toolTipClass = GradientToolTip;
package
{
import flash.display.GradientType;
import flash.geom.Matrix;
import mx.controls.ToolTip;
public class GradientToolTip extends ToolTip
{
public function GradientToolTip()
{
super();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
var gradientBoxMatrix:Matrix = new Matrix();
gradientBoxMatrix.createGradientBox(200, 40, 0, 0, 0);
graphics.lineStyle(5, 0);
graphics.beginGradientFill(GradientType.LINEAR, [0xFF0000, 0x00FF00, 0x0000FF], [1, 1, 1], [0, 128, 255], gradientBoxMatrix);
graphics.drawRect(0, 0, 200, 40);
}
}
}
// to use this class