03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

alphas:Array - An array of alpha values for the corresponding colors in the colors array;<br />

valid values are 0 to 100. If the value is less than 0, Flash uses 0. If the value is greater than<br />

100, Flash uses 100.<br />

ratios:Array - An array of color distribution ratios; valid values are 0 to 255. This value<br />

defines the percentage of the width where the color is sampled at 100%. Specify a value for<br />

each value in the colors parameter.<br />

For example, for a linear gradient that includes two colors, blue <strong>and</strong> green, the following<br />

figure illustrates the placement of the colors in the gradient based on different values in the<br />

ratios array:<br />

ratios Gradient<br />

[0, 127]<br />

[0, 255]<br />

[127, 255]<br />

The values in the array must increase sequentially; for example, [0, 63, 127, 190, 255].<br />

matrix:Object - A transformation matrix that can be in any one of three forms:<br />

■ A matrix object (supported by Flash Player 8 <strong>and</strong> later only), as defined by the<br />

flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox()<br />

method, which lets you conveniently set up the matrix for use with the<br />

beginGradientFill() method of MovieClip class. <strong>Adobe</strong> recommends that you use this<br />

form of matrix for Flash Player 8 <strong>and</strong> later.<br />

The following example uses the beginGradientFill() method with a matrix parameter<br />

of this type:<br />

import flash.geom.*<br />

this.createEmptyMovieClip("gradient_mc", this.getNextHighestDepth());<br />

with (gradient_mc)<br />

{<br />

colors = [0xFF0000, 0x0000FF];<br />

fillType = "radial"<br />

alphas = [100, 100];<br />

ratios = [0, 0xFF];<br />

spreadMethod = "reflect";<br />

interpolationMethod = "linearRGB";<br />

focalPointRatio = 0.9;<br />

matrix = new Matrix();<br />

matrix.createGradientBox(100, 100, Math.PI, 0, 0);<br />

beginGradientFill(fillType, colors, alphas, ratios, matrix,<br />

846 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!