MovieClip.beginGradientFill()
Availability
Flash Player 6.
Usage
my_mc.beginGradientFill(fillType:String, colors:Array, alphas:Array,
ratios:Array, matrix:Object) : Void
Parameter
Either the string
fillType
An array of RGB hex color values to be used in the gradient (for example, red is
colors
0xFF0000, blue is 0x0000FF, and so on).
An array of alpha values for the corresponding colors in the
alphas
are 0–100. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.
An array of color distribution ratios; valid values are 0–255. This value defines the
ratios
percentage of the width where the color is sampled at 100 percent.
A transformation matrix that is an object with either of the following two sets of
matrix
properties.
•
,
,
,
,
,
a
b
c
d
e
f
a b c
d e f
g h i
The following example uses a
an object with these properties.
this.createEmptyMovieClip("gradient_mc", 1);
with (gradient_mc) {
colors = [0xFF0000, 0x0000FF];
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
beginGradientFill("linear", colors, alphas, ratios, matrix);
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
"linear"
,
,
,
, which can be used to describe a 3 x 3 matrix of the following form:
g
h
i
beginGradientFill()
or the string
"radial"
method with a
.
array; valid values
colors
parameter that is
matrix
MovieClip.beginGradientFill()
499
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers