EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Translate (Matrix.translate 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...
782 ActionScript classes
var transformedPoint:Point = myMatrix.transformPoint(myPoint);
trace(transformedPoint); // (450, 0)
var pointMc_0:MovieClip = createRectangle(10, 10, 0xFF0000);
pointMc_0._x = myPoint.x;
var pointMc_1:MovieClip = createRectangle(10, 10, 0x00FF00);
pointMc_1._x = transformedPoint.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;
}
translate (Matrix.translate method)
public translate(tx:Number, ty:Number) : Void
Modifies a Matrix object so that the effect of its transformation is to move an object along the
x and y axes.
The
translate() method alters the tx and ty properties of the matrix object. In matrix
notation, this is shown as follows:
Availability: ActionScript 1.0; Flash Player 8
Parameters
tx:Number - The amount of movement along the x axis to the right, in pixels.
ty:Number - The amount of movement down along the y axis, in pixels.

Table of Contents

Related product manuals