Createbox (Matrix.createbox Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

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()
apply the
identity()
example,
mat1.createBox(2,2,Math.PI/5, 100, 100)
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
- The factor by which to scale horizontally.
scaleX:Number
- The factor by which scale vertically.
scaleY:Number
[optional] - The amount to rotate, in radians. The default value is 0.
rotation:Number
[optional] - The number of pixels to translate (move) to the right along the x axis.
tx:Number
The default value is 0.
[optional] - The number of pixels to translate (move) down along the y axis. The
ty:Number
default value is 0.
770
ActionScript classes
method lets you obtain the same matrix as you would if you were to
,
,
rotate()
scale()
, and
methods in succession. For
translate()
has the same effect as the

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF