Packageorg.aswing.graphics
Classpublic class GradientBrush
ImplementsIBrush

GradientBrush encapsulate the fill paramters for flash.display.Graphics.beginGradientFill()

See also

http://livedocs.macromedia.com/flex/2/langref/flash/display/Graphics.html#beginGradientFill()


Public Methods
 MethodDefined by
  
GradientBrush(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
Create a GradientBrush object
you can refer the explaination for the paramters from Adobe's doc to create a Matrix, you can use matrix.createGradientBox() from the matrix object itself
GradientBrush
  
beginFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It applys the fill paramters to the instance of flash.display.Graphics
GradientBrush
  
endFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It marks the end of filling
GradientBrush
  
getAlphas():Array
GradientBrush
  
getColors():Array
GradientBrush
  
getFillType():String
GradientBrush
  
getMatrix():Object
GradientBrush
  
getRatios():Array
GradientBrush
  
setAlphas(alphas:Array):void
Pay attention that the value in the array should be between 0-1.
GradientBrush
  
setColors(cs:Array):void
GradientBrush
  
setFillType(t:String):void
GradientBrush
  
setMatrix(m:Matrix):void
GradientBrush
  
setRatios(ratios:Array):void
Ratios should be between 0-255, if the value is greater than 255, 255 will be used, if the value is less than 0, 0 will be used
GradientBrush
Public Constants
 ConstantDefined by
  LINEAR : String = "linear"
[static]
GradientBrush
  RADIAL : String = "radial"
[static]
GradientBrush
Constructor detail
GradientBrush()constructor
public function GradientBrush(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)

Create a GradientBrush object
you can refer the explaination for the paramters from Adobe's doc to create a Matrix, you can use matrix.createGradientBox() from the matrix object itself

Parameters
fillType:String
 
colors:Array
 
alphas:Array
 
ratios:Array
 
matrix:Matrix
 
spreadMethod:String (default = "pad")
 
interpolationMethod:String (default = "rgb")
 
focalPointRatio:Number (default = 0)

See also

Method detail
beginFill()method
public function beginFill(target:Graphics):void

This method will be called by Graphics2D autumaticlly.
It applys the fill paramters to the instance of flash.display.Graphics

Parameters
target:Graphics — the instance of a flash.display.Graphics
endFill()method 
public function endFill(target:Graphics):void

This method will be called by Graphics2D autumaticlly.
It marks the end of filling

Parameters
target:Graphics — the instance of a flash.display.Graphics
getAlphas()method 
public function getAlphas():Array

Returns
Array
getColors()method 
public function getColors():Array

Returns
Array
getFillType()method 
public function getFillType():String

Returns
String
getMatrix()method 
public function getMatrix():Object

Returns
Object
getRatios()method 
public function getRatios():Array

Returns
Array
setAlphas()method 
public function setAlphas(alphas:Array):void

Pay attention that the value in the array should be between 0-1. if the value is greater than 1, 1 will be used, if the value is less than 0, 0 will be used

Parameters
alphas:Array
setColors()method 
public function setColors(cs:Array):void

Parameters
cs:Array
setFillType()method 
public function setFillType(t:String):void

Parameters
t:String
setMatrix()method 
public function setMatrix(m:Matrix):void

Parameters
m:Matrix
setRatios()method 
public function setRatios(ratios:Array):void

Ratios should be between 0-255, if the value is greater than 255, 255 will be used, if the value is less than 0, 0 will be used

Parameters
ratios:Array
Constant detail
LINEARconstant
public static const LINEAR:String = "linear"
RADIALconstant 
public static const RADIAL:String = "radial"