beautypg.com

Fill.colorarray, Fill.focalpoint – Adobe Extending Flash Professional CS5 User Manual

Page 223

background image

201

EXTENDING FLASH PROFESSIONAL

Fill object

Last updated 5/2/2011

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"

. 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);

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

fill.style

property is

"radialGradient"

.

This manual is related to the following products: