450
ActionScript classes
Example
The following example creates a square with red fill on the Stage:
this.createEmptyMovieClip("square_mc", this.getNextHighestDepth());
square_mc.beginFill(0xFF0000);
square_mc.moveTo(10, 10);
square_mc.lineTo(100, 10);
square_mc.lineTo(100, 100);
square_mc.lineTo(10, 100);
square_mc.lineTo(10, 10);
square_mc.endFill();
An example is also in the
drawingapi.fla
file in the ActionScript samples folder. The following
list gives typical paths to this folder:
■
Windows:
boot drive
\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
■
Macintosh:
Macintosh HD
/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
moveTo (MovieClip.moveTo method)
,
endFill (MovieClip.endFill method)
,
beginGradientFill (MovieClip.beginGradientFill method)
beginGradientFill (MovieClip.beginGradientFill
method)
public beginGradientFill(fillType:
String
, colors:
Array
, alphas:
Array
,
ratios:
Array
, matrix:
Object
) : Void
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.
Availability:
ActionScript 1.0; Flash Lite 2.0
Summary of Contents for FLASHLITE2 ACTIONSCRIPT-LANGUAGE
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...