![MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference Download Page 774](http://html.mh-extra.com/html/macromedia/flash-8-actionscript-2-0-language/flash-8-actionscript-2-0-language_reference_687537774.webp)
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)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...