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)
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
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
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
This method fails if any of the following conditions exist:
The number of items in the
■
The
parameter is not
■
fillType
Any of the fields in the object for the
■
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Lite 2.0
450
ActionScript classes
,
endFill (MovieClip.endFill method)
MovieClip.endFill()
,
, and
colors
alphas
or
"linear"
"radial"
parameter are missing or invalid.
matrix
undefined,
MovieClip.moveTo()
.
parameters are not equal.
ratios
.
,
or if no
method),