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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

The following example uses myMatrix as a parameter for the MovieClip object's<br />

beginGradientFill() method.<br />

import flash.geom.Matrix;<br />

var myMatrix:Matrix = new Matrix();<br />

trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)<br />

myMatrix.createGradientBox(200, 200, 0, 50, 50);<br />

trace(myMatrix.toString()); // (a=0.1220703125, b=0, c=0, d=0.1220703125,<br />

tx=150, ty=150)<br />

var depth:Number = this.getNextHighestDepth();<br />

var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);<br />

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

var alphas:Array = [100, 100];<br />

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

mc.beginGradientFill("linear", colors, alphas, ratios, myMatrix);<br />

mc.lineTo(0, 300);<br />

mc.lineTo(300, 300);<br />

mc.lineTo(300, 0);<br />

mc.lineTo(0, 0);<br />

See also<br />

beginGradientFill (MovieClip.beginGradientFill method)<br />

d (Matrix.d property)<br />

public d : Number<br />

The value in the second row <strong>and</strong> second column of the Matrix object, which affects the<br />

positioning of pixels along the y axis when scaling or rotating an image.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Example<br />

The following example creates the Matrix object myMatrix <strong>and</strong> sets its d value.<br />

import flash.geom.Matrix;<br />

var myMatrix:Matrix = new Matrix();<br />

trace(myMatrix.d); // 1<br />

myMatrix.d = 2;<br />

trace(myMatrix.d); // 2<br />

782 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!