fl.motion

# MatrixTransformer - AS3 Flash

Package | fl.motion
Class | public class MatrixTransformer
Inheritance | MatrixTransformer Object

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

The MatrixTransformer class contains methods for modifying individual properties of a transformation matrix: 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.

More examples

Geometry example: Applying a matrix transformation to a display object
Defining the MatrixTransformer class

Related API Elements

Motion XML Elements
flash.geom

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | getRotation(m:Matrix):Number [static] Calculates the angle of rotation present in a matrix, in degrees. | MatrixTransformer
|  | getRotationRadians(m:Matrix):Number [static] Calculates the angle of rotation present in a matrix, in radians. | MatrixTransformer
|  | getScaleX(m:Matrix):Number [static] Calculates the horizontal scale present in a matrix. | MatrixTransformer
|  | getScaleY(m:Matrix):Number [static] Calculates the vertical scale present in a matrix. | MatrixTransformer
|  | getSkewX(m:Matrix):Number [static] Calculates the angle of horizontal skew present in a matrix, in degrees. | MatrixTransformer
|  | getSkewXRadians(m:Matrix):Number [static] Calculates the angle of horizontal skew present in a matrix, in radians. | MatrixTransformer
|  | getSkewY(m:Matrix):Number [static] Calculates the angle of vertical skew present in a matrix, in degrees. | MatrixTransformer
|  | getSkewYRadians(m:Matrix):Number [static] Calculates the angle of vertical skew present in a matrix, in radians. | MatrixTransformer
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | matchInternalPointWithExternal(m:Matrix, internalPoint:Point, externalPoint:Point):void [static] Moves a matrix as necessary to align an internal point with an external point. | MatrixTransformer
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | rotateAroundExternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void [static] Rotates a matrix about a point defined outside the matrix's transformation space. | MatrixTransformer
|  | rotateAroundInternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void [static] Rotates a matrix about a point defined inside the matrix's transformation space. | MatrixTransformer
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | setRotation(m:Matrix, rotation:Number):void [static] Changes the angle of rotation in a matrix. | MatrixTransformer
|  | setRotationRadians(m:Matrix, rotation:Number):void [static] Changes the angle of rotation in a matrix. | MatrixTransformer
|  | setScaleX(m:Matrix, scaleX:Number):void [static] Changes the horizontal scale in a matrix. | MatrixTransformer
|  | setScaleY(m:Matrix, scaleY:Number):void [static] Changes the vertical scale in a matrix. | MatrixTransformer
|  | setSkewX(m:Matrix, skewX:Number):void [static] Changes the horizontal skew in a matrix. | MatrixTransformer
|  | setSkewXRadians(m:Matrix, skewX:Number):void [static] Changes the horizontal skew in a matrix. | MatrixTransformer
|  | setSkewY(m:Matrix, skewY:Number):void [static] Changes the vertical skew in a matrix. | MatrixTransformer
|  | setSkewYRadians(m:Matrix, skewY:Number):void [static] Changes the vertical skew in a matrix. | MatrixTransformer
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Method Detail

### getRotation

()
method

`public static function getRotation(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Calculates the angle of rotation present in a matrix, in degrees. If the horizontal and vertical skews are not equal, the vertical skew value is used. This matches the rotation behavior in Flash Player.

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of rotation, in degrees.

Related API Elements

flash.geom.Matrix

### getRotationRadians

()
method

`public static function getRotationRadians(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of rotation, in radians.

Related API Elements

flash.geom.Matrix

### getScaleX

()
method

`public static function getScaleX(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Calculates the horizontal scale present in a matrix.

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The horizontal scale.

Related API Elements

flash.geom.Matrix

### getScaleY

()
method

`public static function getScaleY(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Calculates the vertical scale present in a matrix.

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The vertical scale.

Related API Elements

flash.geom.Matrix

### getSkewX

()
method

`public static function getSkewX(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of horizontal skew, in degrees.

Related API Elements

flash.geom.Matrix

### getSkewXRadians

()
method

`public static function getSkewXRadians(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of horizontal skew, in radians.

Related API Elements

flash.geom.Matrix

### getSkewY

()
method

`public static function getSkewY(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of vertical skew, in degrees.

Related API Elements

flash.geom.Matrix

### getSkewYRadians

()
method

`public static function getSkewYRadians(m:Matrix):Number`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.

Returns

| `Number` — The angle of vertical skew, in radians.

Related API Elements

flash.geom.Matrix

### matchInternalPointWithExternal

()
method

`public static function matchInternalPointWithExternal(m:Matrix, internalPoint:Point, externalPoint:Point):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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 movie clip with one in its parent.

Parameters

| `m:Matrix` — A Matrix instance.
| `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.

Related API Elements

flash.geom.Matrix

### rotateAroundExternalPoint

()
method

`public static function rotateAroundExternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.
| `x:Number` — The x coordinate of the point.
| `y:Number` — The y coordinate of the point.
| `angleDegrees:Number` — The angle of rotation in degrees.

Related API Elements

flash.geom.Matrix

### rotateAroundInternalPoint

()
method

`public static function rotateAroundInternalPoint(m:Matrix, x:Number, y:Number, angleDegrees:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

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

Parameters

| `m:Matrix` — A Matrix instance.
| `x:Number` — The x coordinate of the point.
| `y:Number` — The y coordinate of the point.
| `angleDegrees:Number` — The angle of rotation in degrees.

Related API Elements

flash.geom.Matrix

### setRotation

()
method

`public static function setRotation(m:Matrix, rotation:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the angle of rotation in a matrix. If the horizontal and vertical skews are not equal, the vertical skew is set to the rotation value and the horizontal skew is increased by the difference between the old rotation and the new rotation. This matches the rotation behavior in Flash Player.

Parameters

| `m:Matrix` — A Matrix instance.
| `rotation:Number` — The angle of rotation, in degrees.

Related API Elements

flash.geom.Matrix

### setRotationRadians

()
method

`public static function setRotationRadians(m:Matrix, rotation:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the angle of rotation in a matrix. If the horizontal and vertical skews are not equal, the vertical skew is set to the rotation value and the horizontal skew is increased by the difference between the old rotation and the new rotation. This matches the rotation behavior in Flash Player.

Parameters

| `m:Matrix` — A Matrix instance.
| `rotation:Number` — The angle of rotation, in radians.

Related API Elements

flash.geom.Matrix

### setScaleX

()
method

`public static function setScaleX(m:Matrix, scaleX:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the horizontal scale in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `scaleX:Number` — The new horizontal scale.

Related API Elements

flash.geom.Matrix

### setScaleY

()
method

`public static function setScaleY(m:Matrix, scaleY:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the vertical scale in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `scaleY:Number` — The new vertical scale.

Related API Elements

flash.geom.Matrix

### setSkewX

()
method

`public static function setSkewX(m:Matrix, skewX:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the horizontal skew in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `skewX:Number` — The new horizontal skew, in degrees.

Related API Elements

flash.geom.Matrix

### setSkewXRadians

()
method

`public static function setSkewXRadians(m:Matrix, skewX:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the horizontal skew in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `skewX:Number` — The new horizontal skew, in radians.

Related API Elements

flash.geom.Matrix

### setSkewY

()
method

`public static function setSkewY(m:Matrix, skewY:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the vertical skew in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `skewY:Number` — The new vertical skew, in degrees.

Related API Elements

flash.geom.Matrix

### setSkewYRadians

()
method

`public static function setSkewYRadians(m:Matrix, skewY:Number):void`

Language Version: | ActionScript 3.0

Product Version: | Flash CS3

Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0

Changes the vertical skew in a matrix.

Parameters

| `m:Matrix` — A Matrix instance to be modified.
| `skewY:Number` — The new vertical skew, in radians.

Related API Elements

flash.geom.Matrix

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00