Matrix constructor

public Matrix([a:Number], [b:Number], [c:Number], [d:Number], [tx:Number], [ty:Number])

Creates a new Matrix object with the specified parameters. In matrix notation the properties will be organized like this:



If you do not provide any parameters to the new Matrix() constructor it creates an "identity matrix" with the following values:

a = 1

b = 0

c = 0

d = 1

tx = 0

ty = 0

In matrix notation the identity matrix looks like this:



Availability: ActionScript 1.0; Flash Player 8

Parameters

a:Number [optional] - The value in the first row and first column of the new Matrix object.

b:Number [optional] - The value in the first row and second column of the new Matrix object.

c:Number [optional] - The value in the second row and first column of the new Matrix object.

d:Number [optional] - The value in the second row and second column of the new Matrix object.

tx:Number [optional] - The value in the first row and third column of the new Matrix object.

ty:Number [optional] - The value in the second row and third column of the new Matrix object.

Example

The following example creates matrix_1 by sending no parameters to the Matrix constructor and matrix_2 by sending parameters to it. The Matrix object matrix_1, which is created with no parameters, is an identity Matrix with the values (a=1, b=0, c=0, d=1, tx=0, ty=0).

    import flash.geom.Matrix;

    var matrix_1:Matrix = new Matrix();
    trace(matrix_1); // (a=1, b=0, c=0, d=1, tx=0, ty=0)

    var matrix_2:Matrix = new Matrix(1, 2, 3, 4, 5, 6);
    trace(matrix_2); // (a=1, b=2, c=3, d=4, tx=5, ty=6)

Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001855.html