User Guide
780 ActionScript classes
scale (Matrix.scale method)
public scale(sx:Number, sy:Number) : Void
Modifies a matrix so that its effect, when applied, is to resize an image. In the resized image,
the location of each pixel on the x axis is multiplied by
sx; and on the y axis it is multiplied by
sy.
The
scale() method alters the a and d properties of the matrix object. In matrix notation
this is shown as follows:
Availability: ActionScript 1.0; Flash Player 8
Parameters
sx:Number - A multiplier used to scale the object along the x axis.
sy:Number - A multiplier used to scale the object along the y axis.
Example
The following example uses the
scale() method to scale myMatrix by a factor of three
horizontally and a factor of four vertically.
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 100, 100);
trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=100, ty=100)
myMatrix.scale(3, 4);
trace(myMatrix.toString()); // (a=6, b=0, c=0, d=8, tx=300, ty=400)
toString (Matrix.toString method)
public toString() : String
Returns a text value listing the properties of the Matrix object.
Availability: ActionScript 1.0; Flash Player 8
Returns
String - A string containing the values of the properties of the Matrix object: a, b, c, d, tx,
and
ty.