This code draws the following image onscreen:
,
,
matrixType
x
y
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
The following example uses the
that is an object with these properties:
this.createEmptyMovieClip("gradient_mc", 1);
with (gradient_mc) {
colors = [0xFF0000, 0x0000FF];
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = {matrixType:"box", x:100, y:100, w:200, h:200, r:(45/
180)*Math.PI};
spreadMethod = "reflect";
interpolationMethod = "linearRGB";
lineStyle(8);
lineGradientStyle("linear", colors, alphas, ratios, matrix,
spreadMethod, interpolationMethod);
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
spreadMethod:String
controls the mode of the gradient fill.
interpolationMethod:String
,
,
,
.
w
h
r
w
lineGradientFill()
[optional] - Valid values are "pad", "reflect," or "repeat," which
[optional] - Valid values are "RGB" or "linearRGB".
is the string "
matrixType
is the width of the gradient,
method with a
",
is the horizontal
box
x
is the height of the
h
parameter
matrix
MovieClip
883
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?