| Package | flash.geom |
| Class | public class Transform |
| Inheritance | Transform Object |
A Transform object is normally obtained by getting the value of the
transform property from a display object. You can also use the
new Transform() constructor to create a new Transform object.
See also
| Property | Defined by | ||
|---|---|---|---|
| colorTransform : ColorTransform
A ColorTransform object containing values that universally adjust the colors in
the display object.
| Transform | ||
| concatenatedColorTransform : ColorTransform
[read-only]
A ColorTransform object representing the combined color transformations applied to the display object
and all of its parent objects, back to the root level.
| Transform | ||
| concatenatedMatrix : Matrix
[read-only]
A Matrix object representing the combined transformation matrixes of the
display object and all of its parent objects, back to the root level.
| Transform | ||
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
| matrix : Matrix
A Matrix object containing values that affect the scaling, rotation,
and translation of the display object.
| Transform | ||
| pixelBounds : Rectangle
[read-only]
A Rectangle object that defines the bounding rectangle of the display object on the Stage.
| Transform | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
| colorTransform | property |
colorTransform:ColorTransform [read-write]A ColorTransform object containing values that universally adjust the colors in the display object.
Implementation public function get colorTransform():ColorTransform
public function set colorTransform(value:ColorTransform):void
TypeError — The colorTransform is null when being set
|
See also
| concatenatedColorTransform | property |
concatenatedColorTransform:ColorTransform [read-only]A ColorTransform object representing the combined color transformations applied to the display object and all of its parent objects, back to the root level. If different color transformations have been applied at different levels, all of those transformations are concatenated into one ColorTransform object for this property.
Implementation public function get concatenatedColorTransform():ColorTransform
See also
| concatenatedMatrix | property |
concatenatedMatrix:Matrix [read-only]A Matrix object representing the combined transformation matrixes of the display object and all of its parent objects, back to the root level. If different transformation matrixes have been applied at different levels, all of those matrixes are concatenated into one matrix for this property.
Implementation public function get concatenatedMatrix():Matrix
| matrix | property |
matrix:Matrix [read-write]A Matrix object containing values that affect the scaling, rotation, and translation of the display object.
Implementation public function get matrix():Matrix
public function set matrix(value:Matrix):void
TypeError — The matrix is null when being set
|
See also
| pixelBounds | property |
pixelBounds:Rectangle [read-only]A Rectangle object that defines the bounding rectangle of the display object on the Stage.
Implementation public function get pixelBounds():Rectangle
CustomButton() constructor creates a new sprite object target.CustomButton() constructor calls the draw() method,
which draws a gradient square in the sprite.CustomButton() constructor adds a click event listener for the sprite,
which is handled by the clickHandler() method. clickHandler() method creates a new Matrix object, skewMatrix,
set to apply a skew affect. Another matrix, tempMatrix, is assigned to the
current transformation matrix of the sprite, and then it is combined with the skewMatrix
using the concat() method. This matrix is assigned to the assigned to the
transform.matrix property of the square sprite. Each time the user clicks the square,
the call to the clickHandler() modifies the shape of the square, by skewing it.
package {
import flash.display.Sprite;
import flash.display.GradientType;
import flash.geom.Matrix;
import flash.events.MouseEvent;
public class TransformExample extends Sprite {
public function TransformExample() {
var target:Sprite = new Sprite();
draw(target);
addChild(target);
target.useHandCursor = true;
target.buttonMode = true;
target.addEventListener(MouseEvent.CLICK, clickHandler)
}
public function draw(sprite:Sprite):void {
var red:uint = 0xFF0000;
var green:uint = 0x00FF00;
var blue:uint = 0x0000FF;
var size:Number = 100;
sprite.graphics.beginGradientFill(GradientType.LINEAR, [red, blue, green], [1, 0.5, 1], [0, 200, 255]);
sprite.graphics.drawRect(0, 0, 100, 100);
}
public function clickHandler(event:MouseEvent):void {
var skewMatrix:Matrix = new Matrix();
skewMatrix.c = 0.25;
var tempMatrix:Matrix = this.transform.matrix;
tempMatrix.concat(skewMatrix);
this.transform.matrix = tempMatrix;
}
}
}
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/2/langref/flash/geom/Transform.html
Comments
No screen name said on Jul 18, 2006 at 8:44 AM :