EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Identity (Matrix.identity Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
774 ActionScript classes
var pointMc_1:MovieClip = createRectangle(10, 10, 0x00FF00);
pointMc_1._x = deltaTransformedPoint.x;
function createRectangle(width:Number, height:Number,
color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
identity (Matrix.identity method)
public identity() : Void
Sets each matrix property to a value that cause a transformed movie clip or geometric
construct to be identical to the original.
After calling the
identity() method, the resulting matrix has the following properties: a=1,
b=0, c=0, d=1, tx=0, ty=0
.
In matrix notation the identity matrix looks like this:
Availability: ActionScript 1.0; Flash Player 8
Example
The following example demonstrates that calling the
identity() method converts the calling
Matrix object to an identity Matrix object. The number and types of transformations applied
to the original Matrix object beforehand are irrelevant. If
identity() is called, the Matrix
values are converted to (a=1, b=0, c=0, d=1, tx=0, ty=0).
import flash.geom.Matrix;
var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 0 ,0);
trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
myMatrix.rotate(Math.atan(3/4));
trace(myMatrix.toString()); // (a=1.6, b=1.2, c=-1.2, d=1.6, tx=0, ty=0)

Table of Contents

Related product manuals