Packagecom.flashdynamix.motion.vectors
Classpublic class Gradient
ImplementsIVector

Defines a Gradient vector to be drawn by a VectorLayer.



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.
If the value is less than 0, the default is 0.
Gradient
  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.
Gradient
  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.
Gradient
  height : Number
Gradient
  interpolationMethod : String
A value from the InterpolationMethod class that specifies which value to use:
  • InterpolationMethod.linearRGB
  • InterpolationMethod.RGB
Gradient
  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.
Gradient
  rotation : Number
Gradient
  spreadMethod : String
A value from the SpreadMethod class that specifies which spread method to use:
  • SpreadMethod.PAD
  • SpreadMethod.REFLECT
  • SpreadMethod.REPLAY
Gradient
  type : String
Defines the type of Gradient - this can be:
  • GradientType.LINEAR
  • GradientType.RADIAL
Gradient
  width : Number
Gradient
  x : Number
Gradient
  y : Number
Gradient
Public Methods
 MethodDefined by
  
Gradient(x:Number, y:Number, width:Number, height:Number, rotation:Number, colors:Array, alphas:Array, ratios:Array, type:String = "linear", spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
Gradient
  
draw(vector:Graphics, rect:Rectangle):void
Draws the Gradient into the Graphics instance provided.
Gradient
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.

heightproperty 
height:Number  [read-write]

Implementation
    public function get height():Number
    public function set height(value:Number):void
interpolationMethodproperty 
public var interpolationMethod:String

A value from the InterpolationMethod class that specifies which value to use:

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.

rotationproperty 
rotation:Number  [read-write]

Implementation
    public function get rotation():Number
    public function set rotation(value:Number):void
spreadMethodproperty 
public var spreadMethod:String

A value from the SpreadMethod class that specifies which spread method to use:

typeproperty 
public var type:String

Defines the type of Gradient - this can be:

widthproperty 
width:Number  [read-write]

Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number  [read-write]

Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]

Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor detail
Gradient()constructor
public function Gradient(x:Number, y:Number, width:Number, height:Number, rotation:Number, colors:Array, alphas:Array, ratios:Array, type:String = "linear", spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)

Parameters
x:Number — The current x position in pixels for the Gradient.
 
y:Number — The current y position in pixels for the Gradient.
 
width:Number — The current width in pixels for the Gradient.
 
height:Number — The current height in pixels for the Gradient.
 
rotation:Number — The current rotation in degrees for the Gradient.
 
colors:Array — An Array of RGB hexadecimal color values to be used in the gradient.
 
alphas:Array — An Array of alpha values for the corresponding colors in the colors Array.
 
ratios:Array — An Array of color distribution ratios; valid values are 0 to 255.
 
type:String (default = "linear") — Defines the type of Gradient - this can be either GradientType.LINEAR or GradientType.RADIAL.
 
spreadMethod:String (default = "pad") — A value from the SpreadMethod class that specifies which spread method to use this can be either SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPLAY.
 
interpolationMethod:String (default = "rgb") — A value from the InterpolationMethod class that specifies which value to use this can be either InterpolationMethod.linearRGB or InterpolationMethod.RGB.
 
focalPointRatio:Number (default = 0) — A number that controls the location of the focal point of the Gradient.
Method detail
draw()method
public function draw(vector:Graphics, rect:Rectangle):void

Draws the Gradient into the Graphics instance provided.

Parameters
vector:Graphics
 
rect:Rectangle