03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

gradient_mc._y = -100;<br />

with (gradient_mc)<br />

{<br />

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

fillType = "radial"<br />

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

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

matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};<br />

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

moveTo(100, 100);<br />

lineTo(100, 300);<br />

lineTo(300, 300);<br />

lineTo(300, 100);<br />

lineTo(100, 100);<br />

endFill();<br />

}<br />

This code draws the following image on the screen:<br />

■ matrixType, x, y, w, h, r.<br />

The properties indicate the following: matrixType is the string "box", x is the horizontal<br />

position relative to the registration point of the parent clip for the upper-left corner of the<br />

gradient, y is the vertical position relative to the registration point of the parent clip for<br />

the upper-left corner of the gradient, w is the width of the gradient, h is the height of the<br />

gradient, <strong>and</strong> r is the rotation in radians of the gradient.<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 />

gradient_mc._x = -100;<br />

gradient_mc._y = -100;<br />

with (gradient_mc)<br />

{<br />

412 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!