User Guide
MovieClip 883
This code draws the following image onscreen:
■ matrixType, x, y, w, h, r.
The properties indicate the following:
matrixType is the string "box", x is the horizontal
position relative to the registration point of the parent clip for the upper-left corner of the
gradient,
y is the vertical position relative to the registration point of the parent clip for
the upper-left corner of the gradient,
w is the width of the gradient, h is the height of the
gradient, and
r is the rotation in radians of the gradient.
The following example uses the
lineGradientFill() method with a matrix parameter
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
[optional] - Valid values are "pad", "reflect," or "repeat," which
controls the mode of the gradient fill.
interpolationMethod:String [optional] - Valid values are "RGB" or "linearRGB".