EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Pixelbounds (Transform.pixelbounds Property)

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...
1270 ActionScript classes
Example
The following example applies the Matrix object
scaleMatrix to the Transform object
trans. This Matrix scales the MovieClip rect by a factor of two.
import flash.geom.Transform;
import flash.geom.Matrix;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var trans:Transform = new Transform(rect);
trace(trans.matrix); // (a=1, b=0, c=0, d=1, tx=0, ty=0)
var scaleMatrix:Matrix = new Matrix();
scaleMatrix.scale(2, 2);
rect.onPress() = function() {
trans.matrix = scaleMatrix;
trace(trans.matrix); // (a=2, b=0, c=0, d=2, tx=0, ty=0)
}
function createRectangle(width:Number, height:Number, color:Number,
scope:MovieClip):MovieClip {
scope = (scope == undefined) ? this : scope;
var depth:Number = scope.getNextHighestDepth();
var mc:MovieClip = scope.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;
}
See also
Matrix (flash.geom.Matrix)
pixelBounds (Transform.pixelBounds property)
public pixelBounds : Rectangle
A Rectangle object that defines the bounding rectangle of the MovieClip object on the Stage.
Availability: ActionScript 1.0; Flash Player 8

Table of Contents

Related product manuals