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();
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
An example is also in the drawingapi.fla file in the Samples\ActionScript\DrawingAPI. The
following list gives typical paths to this folder:
Windows: \Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\
Macintosh: HD/Applications/Macromedia Flash 8/Samples and Tutorials/Samples/
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, [spreadMethod:String],
[interpolationMethod:String], [focalPointRatio:Number]) : 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.
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
endFill (MovieClip.endFill method)
MovieClip.endFill()
,
, and
colors
alphas
or
"linear"
"radial"
parameter are missing or invalid.
matrix
method.
undefined,
MovieClip.moveTo()
.
parameters are not equal.
ratios
.
,
or if no
method),
MovieClip
833
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?