User Guide

Matrix (flash.geom.Matrix) 771
Example
The following example sets the
scaleX, scaleY scale, rotation, x location, and y location of
myMatrix by calling its createBox() method.
import flash.geom.Matrix;
import flash.geom.Transform;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.createBox(1, 2, Math.PI/4, 100, 200);
trace(myMatrix.toString()); // (a=0.707106781186548, b=1.41421356237309,
c=-0.707106781186547, d=1.4142135623731, tx=100, ty=200)
var rectangleMc:MovieClip = createRectangle(20, 80, 0xFF0000);
var rectangleTrans:Transform = new Transform(rectangleMc);
rectangleTrans.matrix = myMatrix;
See also
createGradientBox (Matrix.createGradientBox
method)
public createGradientBox(width:Number, height:Number, [rotation:Number],
[tx:Number], [ty:Number]) : Void
Creates the specific style of matrix expected by the MovieClip.beginGradientFill()
method. Width and height are scaled to a
scaleX/scaleY pair and the tx/ty values are offset
by half the width and height.
Availability: ActionScript 1.0; Flash Player 8
Parameters
width:Number - The width of the gradient box.
height:Number - The height of the gradient box.
rotation:Number [optional] - The amount to rotate, in radians. The default value is 0.
tx:Number [optional] - The distance in pixels to translate to the right along the x axis. This
value will be offset by half of the width parameter. The default value is 0.
ty:Number [optional] - The distance in pixels to translate down along the y axis. This value
will be offset by half of the height parameter. The default value is 0.