mx.graphics

# GradientBase - AS3 Flex

Package | mx.graphics
Class | public class GradientBase
Inheritance | GradientBase EventDispatcher Object
Subclasses | GradientStroke, LinearGradient, RadialGradient

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The GradientBase class is the base class for LinearGradient, LinearGradientStroke, and RadialGradient.

Default MXML Property `entries`

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | angle : Number Deprecated: Please Use rotation By default, the LinearGradientStroke defines a transition from left to right across the control. | GradientBase
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | entries : Array An Array of GradientEntry objects defining the fill patterns for the gradient fill. | GradientBase
|  | interpolationMethod : String A value from the InterpolationMethod class that specifies which interpolation method to use. | GradientBase
|  | matrix : Matrix An array of values used for matrix transformation. | GradientBase
|  | rotation : Number By default, the LinearGradientStroke defines a transition from left to right across the control. | GradientBase
|  | spreadMethod : String A value from the SpreadMethod class that specifies which spread method to use. | GradientBase
|  | x : Number The distance by which to translate each point along the x axis. | GradientBase
|  | y : Number The distance by which to translate each point along the y axis. | GradientBase

Protected Properties

| Property | Defined By
--- | --- | ---
|  | compoundTransform : mx.geom:CompoundTransform Holds the matrix and the convenience transform properties (x, y, and rotation). | GradientBase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | GradientBase() Constructor. | GradientBase
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | EventDispatcher
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher

Public Constants

| Constant | Defined By
--- | --- | ---
|  | GRADIENT_DIMENSION : Number = 1638.4 [static] Value of the width and height of the untransformed gradient | GradientBase

Property Detail

### angle

property

`angle:Number`
Deprecated: Please Use rotation

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

By default, the LinearGradientStroke defines a transition from left to right across the control. Use the `angle` property to control the transition direction. For example, a value of 180.0 causes the transition to occur from right to left, rather than from left to right.

The default value is `0.0.`

Implementation
`public function get angle():Number`
`public function set angle(value:Number):void`

### compoundTransform

property

`protected var compoundTransform:mx.geom:CompoundTransform`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Holds the matrix and the convenience transform properties (`x`, `y`, and `rotation`). The compoundTransform is only created when the `matrix` property is set.

### entries

property

`entries:Array`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

An Array of GradientEntry objects defining the fill patterns for the gradient fill.

The default value is `[].`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get entries():Array`
`public function set entries(value:Array):void`

### interpolationMethod

property

`interpolationMethod:String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

A value from the InterpolationMethod class that specifies which interpolation method to use.

Valid values are `InterpolationMethod.LINEAR_RGB` and `InterpolationMethod.RGB`.

The default value is `InterpolationMethod.RGB.`

Implementation
`public function get interpolationMethod():String`
`public function set interpolationMethod(value:String):void`

### matrix

property

`matrix:Matrix`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

An array of values used for matrix transformation.

The gradient `scaleX` and `scaleY` properties represent pixels while the Matrix scale properties represent multipliers. Thus they are not compatible. Another difference is the most of the transform properties (`x`, `y`, `scaleX`, and `scaleY`) support NaN values while the matrix does not. A NaN value means that the gradient will choose an appropriate value.

The `scaleX` and `scaleY` properties can not be represented by the matrix. Once the matrix is set, `scaleX` and `scaleY` can no longer be set. Also, `x` and `y` can not be set to NaN. The matrix can be set back to null which also resets all of the convenience transform properties back to their default values.

If the matrix is set, then the gradient draw logic will scale the gradient to fit the bounds of the graphic element. It will then position the gradient in the upper left corner of the graphic element. Finally, it will apply the matrix transformations.

By default, the LinearGradientStroke defines a transition from left to right across the control. Use the `rotation` property to control the transition direction. For example, a value of 180.0 causes the transition to occur from right to left, rather than from left to right.

The default value is `null.`

Implementation
`public function get matrix():Matrix`
`public function set matrix(value:Matrix):void`

### rotation

property

`rotation:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

By default, the LinearGradientStroke defines a transition from left to right across the control. Use the `rotation` property to control the transition direction. For example, a value of 180.0 causes the transition to occur from right to left, rather than from left to right.

The default value is `0.0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get rotation():Number`
`public function set rotation(value:Number):void`

### spreadMethod

property

`spreadMethod:String`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

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

Valid values are `SpreadMethod.PAD`, `SpreadMethod.REFLECT`, and `SpreadMethod.REPEAT`.

The default value is `SpreadMethod.PAD.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get spreadMethod():String`
`public function set spreadMethod(value:String):void`

### x

property

`x:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The distance by which to translate each point along the x axis.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get x():Number`
`public function set x(value:Number):void`

### y

property

`y:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The distance by which to translate each point along the y axis.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get y():Number`
`public function set y(value:Number):void`
Constructor Detail

### GradientBase

()
Constructor

`public function GradientBase()`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Constructor.

Constant Detail

### GRADIENT_DIMENSION

Constant

`public static const GRADIENT_DIMENSION:Number = 1638.4`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Value of the width and height of the untransformed gradient

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00