colors = [0xFF0000, 0x0000FF];
fillType = "radial"
alphas = [100, 100];
ratios = [0, 0xFF];
spreadMethod = "reflect";
interpolationMethod = "linearRGB";
focalPointRatio = 0.9;
matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
beginGradientFill(fillType, colors, alphas, ratios, matrix,
spreadMethod,
interpolationMethod, focalPointRatio);
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
This code draws the following image onscreen:
An object with the following properties:
The properties indicate the following:
position relative to the registration point of the parent clip for the upper-left corner of the
gradient,
is the vertical position relative to the registration point of the parent clip for
y
the upper-left corner of the gradient,
gradient, and
is the rotation in radians of the gradient.
r
For Flash Player 8 and later, Macromedia recommends that you define the matrix
parameter in the form of a
the list).
The following example uses the
of this type:
this.createEmptyMovieClip("gradient_mc",
this.getNextHighestDepth());
with (gradient_mc)
836
ActionScript classes
matrixType
is the string
matrixType
is the width of the gradient,
w
object (as described in the first item in
flash.geom.Matrix
beginGradientFill()
,
,
,
,
,
.
x
y
w
h
r
,
is the horizontal
"box"
x
is the height of the
h
method with a
matrix
parameter
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?