The skew() method
The
method skews the matrix by adjusting the
skew()
optional parameter,
unit
the method converts the
if (unit == "degrees")
{
angle = Math.PI * 2 * angle / 360;
}
if (unit == "gradients")
{
angle = Math.PI * 2 * angle / 100;
}
A
Matrix object is created and adjusted to apply the skew transformation.
skewMatrix
Initially, it is the identity matrix, as follows:
var skewMatrix:Matrix = new Matrix();
The
parameter determines the side to which the skew is applied. If it is set to
skewSide
, the following code sets the
"right"
skewMatrix.b = Math.tan(angle);
Otherwise, the bottom side is skewed by adjusting the
skewMatrix.c = Math.tan(angle);
The resulting skew is then applied to the existing matrix by concatenating the two matrixes, as
the following example shows:
sourceMatrix.concat(skewMatrix);
return sourceMatrix;
The scale() method
As the following example shows, the
provided as a percentage, and then uses the
if (percent)
{
xScale = xScale / 100;
yScale = yScale / 100;
}
sourceMatrix.scale(xScale, yScale);
return sourceMatrix;
, determines the units used to define the skew angle, and if necessary,
value to radians:
angle
property of the matrix:
b
scale()
scale()
Example: Applying a matrix transformation to a display object
and
properties of the matrix. An
b
c
property of the Matrix, as follows:
c
method first adjusts the scale factor if it is
method of the matrix object:
431
Need help?
Do you have a question about the FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 and is the answer not in the manual?
Questions and answers