Fill.colorarray, Fill.focalpoint – Adobe Extending Flash Professional CS4 User Manual
Page 224
202
EXTENDING FLASH CS4 PROFESSIONAL
Fill object
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.colorArray
Availability
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"
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);
The following example sets the fill to the specified linear gradient:
var fill = fl.getDocumentDOM().getCustomFill();
fill.style = "linearGradient";
fill.colorArray = ["#00ff00","#ff00ff"];
fill.posArray = [0, 255];
fl.getDocumentDOM().setCustomFill(fill);
fill.focalPoint
Availability
Flash 8.
Usage
fill.focalPoint
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
"radialGradient"
.