ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > Matrix (flash.geom.Matrix) > scale (Matrix.scale method) | |||
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
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.
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)
|
|
|
|