Packagemx.graphics
Classpublic class RadialGradient
Implements IFill

The RadialGradient class lets you specify a gradual color transition in the fill color. A radial gradient defines a fill pattern that radiates out from the center of a graphical element. You add a series of GradientEntry classes to the RadialGradient object's entries Array to define the colors that make up the gradient fill.

In MXML, you define a LinearGradient by adding a series of GradientEntry objects, as the following example shows:

You can also define a LinearGradient as a fill for any graphic element in ActionScript, as the following example shows:

MXML SyntaxexpandedHide MXML Syntax

The <mx:RadialGradient> tag inherits all the tag attributes of its superclass, and adds the following tag attributes:

  <mx:RadialGradient
    Properties
    angle="0"
    foculPointRatio="0"
  />
  

See also

mx.graphics.GradientEntry
mx.graphics.LinearGradient
mx.graphics.IFill


Public Properties
 PropertyDefined By
  angle : Number
Sets the location of the start of the radial fill.
RadialGradient
  focalPointRatio : Number = 0
Sets the location of the start of the radial fill.
RadialGradient
Public Methods
 MethodDefined By
  
Constructor.
RadialGradient
  
RadialGradient
  
end(target:Graphics):void
RadialGradient
Property Detail
angleproperty
angle:Number  [read-write]

Sets the location of the start of the radial fill. Use the focalPointRatio property in conjunction with this property to adjust the location and distance from the center point of the bounding Rectangle to the focal point. Valid values are from 0 to 360.

The default value is 0.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
focalPointRatioproperty 
public var focalPointRatio:Number = 0

Sets the location of the start of the radial fill. Valid values are from -1 to 1. A value of -1 sets the focal point (or, start of the gradient fill) on the left of the bounding Rectangle. A value of 1 sets the focal point on the right of the bounding Rectangle.

If you use this property in conjunction with the angle property, this value specifies the degree of distance from the center that the focal point occurs. For example, with an angle of 45 and focalPointRatio of .25, the focal point is slightly lower and to the right of center. If you set focalPointRatio to 1, the focal point is all the way to the bottom right corner of the bounding Rectangle.

The default value is 0, which sets the focal point in the middle of the bounding Rectangle.

Constructor Detail
RadialGradient()Constructor
public function RadialGradient()

Constructor.

Method Detail
begin()method
public function begin(target:Graphics, rc:Rectangle):void

Parameters

target:Graphics — The target Graphics object that is being filled.
 
rc:Rectangle — The Rectangle object that defines the size of the fill inside the target. If the dimensions of the Rectangle are larger than the dimensions of the target, the fill is clipped. If the dimensions of the Rectangle are smaller than the dimensions of the target, the fill expands to fill the entire target.

end()method 
public function end(target:Graphics):void

Parameters

target:Graphics — The Graphics object that is being filled.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/graphics/RadialGradient.html