User Guide
430 Working with Geometry
The DisplayObjectTransformer application files can be found in the folder Samples/
DisplayObjectTransformer. The application consists of the following files:
Defining the MatrixTransformer class
The MatrixTransformer class includes static methods that apply geometric transformations of
Matrix objects.
The transform() method
The transform() method includes parameters for each of the following:
■ sourceMatrix—The input matrix, which the method transforms
■ xScale and yScale—The x and y scale factor
■ dx and dy—The x and y translation amounts, in pixels
■ rotation—The rotation amount, in degrees
■ skew—The skew factor, as a percentage
■ skewType—The direction in which the skew, either "right" or "left"
The return value is the resulting matrix.
The
transform() method calls the following static methods of the class:
■ skew()
■ scale()
■ translate()
■ rotate()
Each returns the source matrix with the applied transformation.
File Description
DisplayObjectTransformer.mxml The main application file in MXML for Flex.
com/example/programmingas3/geometry/
MatrixTransformer.as
A class that contains methods for applying
matrix transformations.
img/ A directory containing sample image files used
by the application.