header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Ankush
Points:240
Posts:0
Answered

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..



1
Glenn
Points: 0
Posts:0
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.

2
Orion
Points: 0
Posts:0
Accepted Answer
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

3
Ankush
Points: 240
Posts:0
5/10/2010 9:37:51 PM



Hey , Thanks Orion.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions