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.

}<br />

beginBitmapFill(bmpd, matrix, repeat, smoothing);<br />

moveTo(0, 0);<br />

lineTo(0, 60);<br />

lineTo(60, 60);<br />

lineTo(60, 0);<br />

lineTo(0, 0);<br />

endFill();<br />

bmp_fill_mc._xscale = 200;<br />

bmp_fill_mc._yscale = 200;<br />

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

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

used in this example.<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 that is specified in a<br />

MovieClip.moveTo() method) <strong>and</strong> a fill is associated with it, that path is closed with a line<br />

<strong>and</strong> then filled. This is similar to what happens when MovieClip.endFill() method is<br />

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 />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Parameters<br />

rgb:Number - A hexadecimal color value; for example, red is 0xFF0000, blue is 0x0000FF. If<br />

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 />

844 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!