ActionScript 3.0 Cookbook: Solutions for Flash Platform and Flex Application Developers

Problem

You want to draw lines using gradient styles.

Solution

Use the Graphics.lineGradientStyle( ) method.

Discussion

The lineGradientStyle( ) method allows you to draw lines with gradient styles. You must still call lineStyle( ) first. However, once you've set the basic line style properties, you can call lineGradientStyle( ) to apply a gradient style to lines. The parameters for the lineGradientStyle( ) method are exactly the same as the parameters for the beginGradientFill( ) method.

See Also

Recipe 7.13 for more about parameters.

Категории