MovieClip.beginGradientFill()
563
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
If a
matrixType
property does not exist then the remaining parameters are all required; the
function fails if any of them are missing. This matrix scales, translates, rotates, and skews the
unit gradient, which is defined at (-1,-1) and (1,1).
•
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 a
beginGradientFill()
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};
beginGradientFill("linear", colors, alphas, ratios, matrix);
moveTo(100, 100);
lineTo(100, 300);
lineTo(300, 300);
lineTo(300, 100);
lineTo(100, 100);
endFill();
}
Summary of Contents for FLEX
Page 1: ...Flex ActionScript Language Reference ...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Page 135: ...case 135 See also break default strict equality switch ...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Page 808: ...808 Chapter 7 ActionScript for Flash ...
Page 810: ...810 Appendix A Deprecated Flash 4 operators ...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Page 822: ...822 Index ...