03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

square_mc.lineTo(10, 10);<br />

square_mc.endFill();<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.<br />

Download <strong>and</strong> decompress the Samples zip file <strong>and</strong> go to the <strong>ActionScript</strong><strong>2.0</strong>\DrawingAPI<br />

folder to access the drawingapi.fla file.<br />

See also<br />

moveTo (MovieClip.moveTo method), endFill (MovieClip.endFill method),<br />

beginGradientFill (MovieClip.beginGradientFill method)<br />

beginGradientFill (MovieClip.beginGradientFill<br />

method)<br />

public beginGradientFill(fillType:String, colors:Array, alphas:Array,<br />

ratios:Array, matrix:Object, [spreadMethod:String],<br />

[interpolationMethod:String], [focalPointRatio:Number]) : Void<br />

Indicates the beginning of a new drawing path. If the first parameter is undefined, or if no<br />

parameters are passed, the path has no fill. If an open path exists (that is if the current drawing<br />

position does not equal the previous position specified in a MovieClip.moveTo() method),<br />

<strong>and</strong> it has a fill associated with it, that path is closed with a line <strong>and</strong> then filled. This is similar<br />

to what happens when you call MovieClip.endFill().<br />

This method fails if any of the following conditions exist:<br />

■ The number of items in the colors, alphas, <strong>and</strong> ratios parameters are not equal.<br />

■ The fillType parameter is not "linear" or "radial".<br />

■ Any of the fields in the object for the matrix parameter are missing or invalid.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6 - Additional parameters spreadMethod,<br />

interpolationMethod, <strong>and</strong> focalPointRatio added in Flash Player 8.<br />

Parameters<br />

fillType:String - Valid values are the string "linear" <strong>and</strong> the string "radial".<br />

colors:Array - An array of RGB hexadecimal color values you can use in the gradient; for<br />

example; red is 0xFF0000, blue is 0x0000FF. You can specify up to 15 colors. For each color,<br />

ensure to specify a corresponding value in the alphas <strong>and</strong> ratios parameters.<br />

MovieClip 845

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!