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

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example applies the Matrix object
. This Matrix scales the MovieClip
trans
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
1270
ActionScript classes
scaleMatrix
by a factor of two.
rect
to the Transform object

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