MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 934

Actionscript 2.0 language reference
Table of Contents

Advertisement

myNewDisplayObj.transform = myOldDisplayObj.transform;
The new movie clip,
transform, and pixel bounds as the old movie clip,
Availability: ActionScript 1.0; Flash Player 8
Example
The following example shows how to use a movie clip's
modify a movie clip's location by using Matix positioning.
import flash.geom.Matrix;
var rect:MovieClip = createRectangle(20, 80, 0xFF0000);
var translateMatrix:Matrix = new Matrix();
translateMatrix.translate(10, 0);
rect.onPress = function() {
var tmpMatrix:Matrix = this.transform.matrix;
tmpMatrix.concat(translateMatrix);
this.transform.matrix = tmpMatrix;
}
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;
}
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
used in this example.
See also
Transform (flash.geom.Transform)
934
ActionScript classes
, now has the same values for its matrix, color
myNewDisplayObj
MovieClip.getNextHighestDepth()
.
myOldDisplayObj
property to access and
transform
method, which is

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