|
Flash CS4 Resources |
document.getCustomFill()Parameters
ReturnsThe Fill object specified by the objectToFill parameter, if successful; otherwise, it returns undefined. DescriptionMethod; retrieves the fill object of the selected shape or, if specified, of the Tools panel and Property inspector. ExampleThe following example gets the fill object of the selection and then changes the selection’s color to white: var fill = fl.getDocumentDOM().getCustomFill(); fill.color = '#FFFFFF'; fill.style = "solid"; fl.getDocumentDOM().setCustomFill(fill); The following example returns the fill object of the Tools panel and Property inspector and then changes the color swatch to a linear gradient: var fill = fl.getDocumentDOM().getCustomFill("toolbar");
fill.style = "linearGradient";
fill.colorArray = [ 0x00ff00, 0xff0000, 0x0000ff ];
fill.posArray = [0, 100, 200];
fl.getDocumentDOM().setCustomFill( fill );
|