
882
ActionScript classes
For example, for a linear gradient that includes two colors, blue and green, the following
figure illustrates the placement of the colors in the gradient based on different values in the
ratios
array:
The values in the array must increase, sequentially; for example,
[0, 63, 127, 190, 255]
.
matrix
:Object
- A transformation matrix that is an object with one of the following sets of
properties:
■
You can use the properties
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
to describe a 3 x 3 matrix of the following
form:
a b c
d e f
g h i
The following example uses the
lineGradientFill()
method with a
matrix
parameter
that is an object with the following 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};
spreadMethod = "reflect";
interpolationMethod = "linearRGB";
focalPointRatio = 0.9;
lineStyle(8);
lineGradientStyle("linear", colors, alphas, ratios, matrix,
spreadMethod, interpolationMethod, focalPointRatio);
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
ratios
Gradient
[0, 127]
[0, 255]
[127, 255]
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...