564
Chapter 7: ActionScript for Flash
If a
matrixType
property exists then it must equal
"box"
and the remaining parameters are all
required. The function fails if any of these conditions are not met.
Returns
Nothing.
Description
Method; indicates the beginning of a new drawing path. If the first parameter is
undefined,
or if
no parameters are passed, the path has no fill. If an open path exists (that is if the current drawing
position does not equal the previous position specified in a
MovieClip.moveTo()
method), and
it has a fill associated with it, that path is closed with a line and then filled. This is similar to what
happens when you call
MovieClip.endFill()
.
This method fails if any of the following conditions exist:
•
The number of items in the
colors
,
alphas
, and
ratios
parameters are not equal.
•
The
fillType
parameter is not
"linear"
or
"radial"
.
•
Any of the fields in the object for the
matrix
parameter are missing or invalid.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Example
The following code uses both methods to draw two stacked rectangles with a red-blue gradient fill
and a 5-pixel solid lime green stroke:
this.createEmptyMovieClip("gradient_mc", 1);
with (gradient_mc) {
colors = [0xFF0000, 0x0000FF];
alphas = [100, 100];
ratios = [0, 0xFF];
lineStyle(5, 0x00ff00);
matrix = {a:500, b:0, c:0, d:0, e:200, f:0, g:350, h:200, i:1};
beginGradientFill("linear", colors, alphas, ratios, matrix);
moveTo(100, 100);
lineTo(100, 300);
lineTo(600, 300);
lineTo(600, 100);
lineTo(100, 100);
endFill();
matrix = {matrixType:"box", x:100, y:310, w:500, h:200, r:(0/180)*Math.PI};
beginGradientFill("linear", colors, alphas, ratios, matrix);
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
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...