AFComponents.com

Example of Gradient Background
Date: Oct 19, 2007   Views: 6105  
Question:
I was looking through the API but couldn't seem to find an example of how to create a gradient background on the AS3 Tooltip component, could you please provide one?
Answer:

andreit (Admin)
You need to create a gradient object and assign it to the component. Below is the working code sample.

var gradientDefault:Object = new Object;

gradientDefault.fillType = "linear";
gradientDefault.colors = [0x8899FF99, 0xFFFFFFFF];
gradientDefault.ratios = [0, 255];
gradientDefault.matrix = new flash.geom.Matrix();
gradientDefault.matrix.createGradientBox(100, 50, (Math.PI * 3 / 2), 0, 0);

import com.afcomponents.tooltip.ContentType;

myTooltip.type = ContentType.TEXT;
myTooltip.content = "Testing Gradient";
myTooltip.shapeStyle.fillGradient = gradientDefault;
Component Info


© 2005-2007 advanced flash components