Example
The following example creates
and converts its values to a string in the format of
myMatrix
(a=A, b=B, c=C, d=D, tx=TX, ty=TY).
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix();
trace("myMatrix: " + myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0,
ty=0)
transformPoint (Matrix.transformPoint method)
public transformPoint(pt:Point) : Point
Applies the geometric transformation represented by the Matrix object to the specified point.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The Point (x,y) to be transformed.
pt:flash.geom.Point
Returns
- The new Point object.
flash.geom.Point
Example
The following example uses the
method to create
transformPoint()
transformedPoint
from
. The
method does have an affect on the position of
myPoint
translate()
. In the example,
increases the original
value by a factor of
transformedPoint
scale()
x
three from 50 to 150, and the
method increases
by 300 for a total value of
translate()
x
450.
import flash.geom.Matrix;
import flash.geom.Point;
var myMatrix:Matrix = new Matrix();
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.translate(100, 0);
trace(myMatrix); // (a=1, b=0, c=0, d=1, tx=100, ty=0)
myMatrix.scale(3, 3);
trace(myMatrix); // (a=3, b=0, c=0, d=3, tx=300, ty=0)
var myPoint:Point = new Point(50,0);
trace(myPoint); // (50, 0)
Matrix (flash.geom.Matrix)
781
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?