< Day Day Up > |
Availability Flash MX 2004. Description This object contains all the properties of the Fill color setting of the Tools panel or of a selected shape. To retrieve a Fill object, use document.getCustomFill(). Property summary for the Fill objectThe following properties are available for the Fill object:
fill.colorAvailability Flash MX 2004. Usage fill.color Description Property; the color of the fill, in one of the following formats:
Example The following example sets the fill color of the current selection: var fill = fl.getDocumentDOM().getCustomFill(); fill.color = '#FFFFFF'; fl.getDocumentDOM().setCustomFill( fill ); fill.colorArrayAvailability Flash MX 2004. Usage fill.colorArray Description Property; an array of colors in the gradient, expressed as integers. This property is available only if the value of the fill.style property is either "radialGradient" or "linearGradient". See fill.style Example The following example displays the color array of the current selection, if appropriate, in the Output panel: var fill = fl.getDocumentDOM().getCustomFill(); if(fill.style == "linearGradient" || fill.style == "radialGradient") alert(fill.colorArray); fill.focalPointAvailability Flash 8. Usage fill.focalPoin Description Property; an integer that specifies the gradient focal point horizontal offset from the transformation point. A value of 10, for example, would place the focal point at 10/255 of the distance from the transformation point to the edge of the gradient. A value of -255 would place the focal point at the left boundary of the gradient. The default value is 0. This property is available only if the value of the fill.style property is "radialGradient". Example The following example sets the focal point of a radial gradient to 10 pixels to the right of the shape's center. var fill = fl.getDocumentDOM().getCustomFill(); fill.focalPoint = 10; fl.getDocumentDOM().setCustomFill(fill); fill.linearRGBAvailability Flash 8. Usage fill.linearRGB Description Property; a Boolean value that specifies whether to render the fill as a linear or radial RGB gradient. Set this property to TRue to specify a linear interpolation of a gradient; set it to false to specify a radial interpolation of a gradient. The default value is false. Example The following example specifies that the gradient should be rendered with a linear RGB. var fill = fl.getDocumentDOM().getCustomFill(); fill.linearRGB = true; fl.getDocumentDOM().setCustomFill(fill); fill.matrixAvailability Flash MX 2004. Usage fill.matrix Description Property; a Matrix object that defines the placement, orientation, and scales for gradient fills. fill.overflowAvailability Flash 8. Usage fill.overflow Description Property; a string that specifies the behavior of a gradient's overflow. Acceptable values are "extend", "repeat", and "reflect"; the strings are not case-sensitive. The default value is "extend". Example The following example specifies that the behavior of the overflow should be "extend". var fill = fl.getDocumentDOM().getCustomFill(); fill.overflow = "extend"; fl.getDocumentDOM().setCustomFill(fill); fill.posArrayAvailability Flash MX 2004. Usage fill.posArray Description Property; an array of integers, each in the range 0 ... 255, indicating the position of the corresponding color. This property is available only if the value of the fill.style property is either "radialGradient" or "linearGradient". Example The following example specifies the colors to use in a linear gradient for the current selection: var fill = fl.getDocumentDOM().getCustomFill(); fill.style = "linearGradient"; fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ]; fill.posArray = [0, 100, 200]; fl.getDocumentDOM().setCustomFill( fill ); fill.styleAvailability Flash MX 2004. Usage fill.style Description Property; a string that specifies the fill style. Acceptable values are "solid", "linearGradient", "radialGradient", and "noFill". If an object has no fill, this property has a value of "noFill". If this value is "linearGradient" or "radialGradient", the properties fill.colorArray and fill.posArray are also available. Example The following example specifies the colors to use in a linear gradient for the current selection: var fill = fl.getDocumentDOM().getCustomFill(); fill.style= "linearGradient"; fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ]; fill.posArray = [0, 100, 200]; fl.getDocumentDOM().setCustomFill( fill ); |
< Day Day Up > |