The use of transform. matrix is cumbersome, but its advantage is its powerful functionality: The Matrix. Concat () method can be used to easily oblique deformation of display objects:
VaR mymatrix: matrix = matrix_rect.transform.matrix;
VaR tempx, Tempy;
Tempx = matrix_rect.x + matrix_rect.width/2;
Tempy = matrix_rect.y + matrix_rect.height/2;
Mymatrix. Translate (-tempx,-Tempy );
// Achieve oblique Shear DeformationCodeStart
VaR skewmatrix: matrix = new matrix ();
Skewmatrix. B = math. Tan (1 );
Mymatrix. Concat (skewmatrix );
// End the code for oblique Deformation
Mymatrix. Rotate (2 * Math. Pi * (-45/360 ));
Mymatrix. Translate (tempx, Tempy );
Matrix_rect.transform.matrix = mymatrix;
Display Effect (http://blog.csdn.net/AS3_Flash/archive/2008/04/18/2303066.aspx), the rectangle is skewed horizontally.
Skewmatrix. B is used to set horizontal skew. To set vertical skew, you need to access the skewmatrix. A attribute. By changing the value of the X variable in math. Tan (x), you can control the oblique tangent amplitude.
Oblique deformation is an animation deformation that is useful in cartoon animation. When an object that simulates rapid motion suddenly stops, or a static object suddenly accelerates, and an animated image such as a pudding swinging in the tray, oblique shear deformation has its own application world.
This article from the csdn blog, source: http://blog.csdn.net/AS3_Flash/archive/2008/04/18/2303066.aspx