490
Chapter 12: ActionScript Dictionary
MovieClip.beginGradientFill()
Availability
Flash Player 6.
Usage
my_mc
.beginGradientFill(
fillType
,
colors
,
alphas
,
ratios
,
matrix
)
Parameter
fillType
Either the string
"
linear
"
or the string
"
radial
"
.
colors
An array of RGB hex color values to be used in the gradient (for example, red is
0xFF0000, blue is 0x0000FF, and so on).
alphas
An array of alpha values for the corresponding colors in the
colors
array; valid values
are 0–100. If the value is less than 0, Flash uses 0. If the value is greater than 100, Flash uses 100.
ratios
An array of color distribution ratios; valid values are 0–255. This value defines the
percentage of the width where the color is sampled at 100 percent.
matrix
A transformation matrix that is an object with either of the following two sets of
properties.
•
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
, which can be used to describe a 3 x 3 matrix of the following form:
a b c
d e f
g h i
The following example uses a
beginGradientFill()
method with a
matrix
parameter that is
an object with these properties.
_root.createEmptyMovieClip( "grad", 1 );
with ( _root.grad )
{
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();
}
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...