beginGradientFill()
Top  Previous  Next


SWiSH Player Support
SWF6 or later - Not Supported (Use File | Test | Browser/Player)

Syntax
mySprite.beginFill(fillType, colors, alphas, ratios, matrix)

Arguments
fillType: either "linear" or "radial"
colors: an array of hex color values that will be used in the gradient fill (eg. 0x000000 is black, 0xFFFFFF is white, etc.)
alphas: an array of opacity levels that correspond with the color arrays. Acceptables values range from 0 (transparent) through 100 (opaque).
ratios: An array of color distribution ratios. Acceptables values range from 0 through 255.
matrix: A transformation matrix that is an object with either of the following two sets of properties.

·    a, b, c, d, e, f, g, h, i, which can be used to describe a 3 x 3 matrix of the following form:  

a
b
c
d
e
f
g
h
i
 

If a matrixType property is omitted then the remaining arguments are all required; the function fails if any are missing. This matrix rotates, scales, and skews the unit gradient which is defined at (-1,-1) and (1,1).

·    matrixType, x, y, w, h, r.  

The properties indicate the following: matrixType is the string "box".
x and y are the horizontal (x) and vertical (y) positions relative to the anchor point of the parent Sprite for the top-left corner of the gradient.
w; is the width of the gradient.
h; is the height of the gradient
r; is the rotation of the gradient in radians.

If a matrixType property exists then it must equal "box" and the remaining arguments are all required. The function fails if any of these conditions are not met.


Returns
Nothing.

Description
Method; drawing method indicating the start of a new drawing path. This method will fail if any of the following occur:

·    The number of elements in the colors, alphas, and ratios arrays are not equal  
·    The fillType argument is not defines as either "linear" or "radial"  
·    Any field for the matrix agrument are missing or invalid.