Packagegraphics.geom
Classpublic class MatrixTransform
InheritanceMatrixTransform Inheritance Object

Helper to transform a flash.geomatrix.Matrix. This class can change horizontal and vertical scale, horizontal and vertical skew, and rotation. This class also has methods for rotating around a given transformation point rather than the typical (0, 0) point.



Public Properties
 PropertyDefined By
  degrees : Boolean
Indicates if all calcul use angles in degrees or radians.
MatrixTransform
  matrix : Matrix
The Matrix reference to transform.
MatrixTransform
  rotation : Number
Calculates the angle of rotation present in a matrix.
MatrixTransform
  scaleX : Number
Calculates the horizontal scale present in a matrix.
MatrixTransform
  scaleY : Number
Calculates the vertical scale present in a matrix.
MatrixTransform
  skewX : Number
Calculates the angle of horizontal skew present in a matrix, in radians.
MatrixTransform
  skewY : Number
Calculates the angle of vertical skew present in a matrix, in radians.
MatrixTransform
Public Methods
 MethodDefined By
  
MatrixTransform(matrix:Matrix = null, degrees:Boolean = false)
Creates a new MatrixTransform instance.
MatrixTransform
  
matchInternalPointWithExternal(internalPoint:Point, externalPoint:Point):void
Moves a matrix as necessary to align an internal point with an external point.
MatrixTransform
  
rotateAroundExternalPoint(point:Point, angle:Number):void
Rotates a matrix about a point defined outside the matrix's transformation space.
MatrixTransform
  
rotateAroundInternalPoint(point:Point, angle:Number):void
Rotates a matrix about a point defined inside the matrix's transformation space.
MatrixTransform
Protected Constants
 ConstantDefined By
  DEG2RAD : Number = 0.017453292519943295
This constant change degrees to radians : Math.PI/180.
MatrixTransform
  RAD2DEG : Number = 57.29577951308232
This constant change radians to degrees : 180/Math.PI.
MatrixTransform
Property Detail
degreesproperty
public var degrees:Boolean

Indicates if all calcul use angles in degrees or radians.

matrixproperty 
public var matrix:Matrix

The Matrix reference to transform.

rotationproperty 
rotation:Number

Calculates the angle of rotation present in a matrix. If the horizontal and vertical skews are not equal, the vertical skew value is used.


Implementation
    public function get rotation():Number
    public function set rotation(value:Number):void

See also

flash.geom.Matrix
scaleXproperty 
scaleX:Number

Calculates the horizontal scale present in a matrix.


Implementation
    public function get scaleX():Number
    public function set scaleX(value:Number):void

See also

flash.geomatrix.Matrix
scaleYproperty 
scaleY:Number

Calculates the vertical scale present in a matrix.


Implementation
    public function get scaleY():Number
    public function set scaleY(value:Number):void

See also

flash.geom.Matrix
skewXproperty 
skewX:Number

Calculates the angle of horizontal skew present in a matrix, in radians.


Implementation
    public function get skewX():Number
    public function set skewX(value:Number):void

See also

flash.geom.Matrix
skewYproperty 
skewY:Number

Calculates the angle of vertical skew present in a matrix, in radians.


Implementation
    public function get skewY():Number
    public function set skewY(value:Number):void

See also

flash.geom.Matrix
Constructor Detail
MatrixTransform()Constructor
public function MatrixTransform(matrix:Matrix = null, degrees:Boolean = false)

Creates a new MatrixTransform instance.

Parameters
matrix:Matrix (default = null) — The Matrix reference to transform.
 
degrees:Boolean (default = false) — Indicates if all calcul use angles in degrees or radians (default use radians angles).
Method Detail
matchInternalPointWithExternal()method
public function matchInternalPointWithExternal(internalPoint:Point, externalPoint:Point):void

Moves a matrix as necessary to align an internal point with an external point. This can be used to match a point in a transformed DisplayObject with one in its parent.

Parameters

internalPoint:Point — A Point instance defining a position within the matrix's transformation space.
 
externalPoint:Point — A Point instance defining a reference position outside the matrix's transformation space.

rotateAroundExternalPoint()method 
public function rotateAroundExternalPoint(point:Point, angle:Number):void

Rotates a matrix about a point defined outside the matrix's transformation space. This can be used to rotate a DisplayObject around a transformation point in its parent.

Parameters

point:Point — The anchor point reference.
 
angle:Number — The angle of rotation.

rotateAroundInternalPoint()method 
public function rotateAroundInternalPoint(point:Point, angle:Number):void

Rotates a matrix about a point defined inside the matrix's transformation space. This can be used to rotate a DisplayObject around a transformation point inside itself.

Parameters

point:Point — The anchor point reference.
 
angle:Number — The angle of rotation.

Constant Detail
DEG2RADConstant
protected const DEG2RAD:Number = 0.017453292519943295

This constant change degrees to radians : Math.PI/180.

RAD2DEGConstant 
protected const RAD2DEG:Number = 57.29577951308232

This constant change radians to degrees : 180/Math.PI.