Packagegraphics
Classpublic class GradientStyle
InheritanceGradientStyle Inheritance Object
Subclasses FillGradientStyle, LineGradientStyle

Defines the basic core style to defines the LineGradientStyle and the fillGradientStyle class.



Public Properties
 PropertyDefined By
  alphas : Array
An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1.
GradientStyle
  colors : Array
An array of RGB hexadecimal color values to be used in the gradient ; for example, red is 0xFF0000, blue is 0x0000FF, and so on.
GradientStyle
  focalPointRatio : Number
A number that controls the location of the focal point of the gradient.
GradientStyle
  interpolationMethod : String
A value from the InterpolationMethod class that specifies which value to use : InterpolationMethod.linearRGB or InterpolationMethod.RGB
GradientStyle
  matrix : Matrix
A transformation matrix as defined by the flash.geom.Matrix class.
GradientStyle
  ratios : Array
An array of color distribution ratios; valid values are 0 to 255.
GradientStyle
  spreadMethod : String
A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.
GradientStyle
  type : String
A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.
GradientStyle
Public Methods
 MethodDefined By
  
GradientStyle(type:String = null, colors:Array = null, alphas:Array = null, ratios:Array = null, matrix:Matrix = null, spreadMethod:String = pad, interpolationMethod:String = rgb, focalPointRatio:Number = 0)
Creates a new GradientStyle instance.
GradientStyle
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
GradientStyle
Property Detail
alphasproperty
public var alphas:Array

An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

colorsproperty 
public var colors:Array

An array of RGB hexadecimal color values to be used in the gradient ; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, be sure you specify a corresponding value in the alphas and ratios parameters.

focalPointRatioproperty 
public var focalPointRatio:Number

A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1.

interpolationMethodproperty 
public var interpolationMethod:String

A value from the InterpolationMethod class that specifies which value to use : InterpolationMethod.linearRGB or InterpolationMethod.RGB

matrixproperty 
public var matrix:Matrix

A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.

ratiosproperty 
public var ratios:Array

An array of color distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.

spreadMethodproperty 
public var spreadMethod:String

A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.

typeproperty 
public var type:String

A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.

Constructor Detail
GradientStyle()Constructor
public function GradientStyle(type:String = null, colors:Array = null, alphas:Array = null, ratios:Array = null, matrix:Matrix = null, spreadMethod:String = pad, interpolationMethod:String = rgb, focalPointRatio:Number = 0)

Creates a new GradientStyle instance.

Parameters
type:String (default = null) — A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.
 
colors:Array (default = null) — An array of RGB hexadecimal color values to be used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, be sure you specify a corresponding value in the alphas and ratios parameters.
 
alphas:Array (default = null) — An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.
 
ratios:Array (default = null) — An array of color distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.
 
matrix:Matrix (default = null) — A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.
 
spreadMethod:String (default = pad) — A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.
 
interpolationMethod:String (default = rgb) — A value from the InterpolationMethod class that specifies which value to use: InterpolationMethod.linearRGB or InterpolationMethod.RGB.
 
focalPointRatio:Number (default = 0) — A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1.
Method Detail
toSource()method
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.