Example
The following example sets the
by calling its
myMatrix
import flash.geom.Matrix;
import flash.geom.Transform;
var myMatrix:Matrix = new Matrix();
trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
myMatrix.createBox(1, 2, Math.PI/4, 100, 200);
trace(myMatrix.toString()); // (a=0.707106781186548, b=1.41421356237309,
c=-0.707106781186547, d=1.4142135623731, tx=100, ty=200)
var rectangleMc:MovieClip = createRectangle(20, 80, 0xFF0000);
var rectangleTrans:Transform = new Transform(rectangleMc);
rectangleTrans.matrix = myMatrix;
See also
createGradientBox (Matrix.createGradientBox
method)
public createGradientBox(width:Number, height:Number, [rotation:Number],
[tx:Number], [ty:Number]) : Void
Creates the specific style of matrix expected by the
method. Width and height are scaled to a
by half the width and height.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The width of the gradient box.
width:Number
- The height of the gradient box.
height:Number
[optional] - The amount to rotate, in radians. The default value is 0.
rotation:Number
[optional] - The distance in pixels to translate to the right along the x axis. This
tx:Number
value will be offset by half of the width parameter. The default value is 0.
[optional] - The distance in pixels to translate down along the y axis. This value
ty:Number
will be offset by half of the height parameter. The default value is 0.
,
scaleX
scaleY
method.
createBox()
scaleX
scale, rotation, x location, and y location of
MovieClip.beginGradientFill()
/
pair and the
scaleY
Matrix (flash.geom.Matrix)
/
values are offset
tx
ty
771
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?