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.

lineTo(300, 300);<br />

lineTo(300, 100);<br />

lineTo(100, 100);<br />

endFill();<br />

}<br />

This code draws the following image onscreen:<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 lineGradientFill() method with a matrix parameter<br />

that is an object with these properties:<br />

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

with (gradient_mc) {<br />

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

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

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

matrix = {matrixType:"box", x:100, y:100, w:200, h:200, r:(45/<br />

180)*Math.PI};<br />

spreadMethod = "reflect";<br />

interpolationMethod = "linearRGB";<br />

lineStyle(8);<br />

lineGradientStyle("linear", colors, alphas, ratios, matrix,<br />

spreadMethod, interpolationMethod);<br />

moveTo(100, 100);<br />

lineTo(100, 300);<br />

lineTo(300, 300);<br />

lineTo(300, 100);<br />

lineTo(100, 100);<br />

endFill();<br />

}<br />

MovieClip 895

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

Saved successfully!

Ooh no, something went wrong!