03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

See also<br />

removeMovieClip (MovieClip.removeMovieClip method), unloadMovie<br />

(MovieClip.unloadMovie method), removeMovieClip function<br />

beginFill (MovieClip.beginFill method)<br />

public beginFill(rgb:Number, [alpha:Number]) : Void<br />

Indicates the beginning of a new drawing path. If an open path exists (that is, if the current<br />

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

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

similar to what happens when MovieClip.endFill() is called.<br />

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

Parameters<br />

rgb:Number - A hex color value (for example, red is 0xFF0000, blue is 0x0000FF, <strong>and</strong> so on).<br />

If this value is not provided or is undefined, a fill is not created.<br />

alpha:Number [optional] - An integer from 0 to 100 that specifies the alpha value of the fill.<br />

If this value is not provided, 100 (solid) is used. If the value is less than 0, Flash uses 0. If the<br />

value is greater than 100, Flash uses 100.<br />

Example<br />

The following example creates a square with red fill on the Stage:<br />

this.createEmptyMovieClip("square_mc", this.getNextHighestDepth());<br />

square_mc.beginFill(0xFF0000);<br />

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

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

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

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

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

square_mc.endFill();<br />

An example is also in the drawingapi.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<br />

See also<br />

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

beginGradientFill (MovieClip.beginGradientFill method)<br />

410 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!