User Guide

770 ActionScript classes
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;
}
createBox (Matrix.createBox method)
public createBox(scaleX:Number, scaleY:Number, [rotation:Number],
[tx:Number], [ty:Number]) : Void
Includes parameters for scaling, rotation, and translation. When applied to a matrix it sets the
matrix's values based on those parameters.
Using the
createBox() method lets you obtain the same matrix as you would if you were to
apply the
identity(), rotate(), scale(), and translate() methods in succession. For
example,
mat1.createBox(2,2,Math.PI/5, 100, 100) has the same effect as the
following:
import flash.geom.Matrix;
var mat1:Matrix = new Matrix();
mat1.identity();
mat1.rotate(Math.PI/4);
mat1.scale(2,2);
mat1.translate(10,20);
Availability: ActionScript 1.0; Flash Player 8
Parameters
scaleX:Number - The factor by which to scale horizontally.
scaleY:Number - The factor by which scale vertically.
rotation:Number [optional] - The amount to rotate, in radians. The default value is 0.
tx:Number [optional] - The number of pixels to translate (move) to the right along the x axis.
The default value is 0.
ty:Number [optional] - The number of pixels to translate (move) down along the y axis. The
default value is 0.