User Guide
Rectangle (flash.geom.Rectangle) 1051
topLeft (Rectangle.topLeft property)
public topLeft : Point
The location of the Rectangle object's top-left corner determined by the x and y values of the
point.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example sets the Rectangle object's
topLeft property using the values in a
Point object. Notice that
rect.x and rect.y are changed.
import flash.geom.Rectangle;
import flash.geom.Point;
var rect:Rectangle = new Rectangle();
trace(rect.left); // 0
trace(rect.top); // 0
trace(rect.x); // 0
trace(rect.y); // 0
var myTopLeft:Point = new Point(5, 15);
rect.topLeft = myTopLeft;
trace(rect.left); // 5
trace(rect.top); // 15
trace(rect.x); // 5
trace(rect.y); // 15
See also
Point (flash.geom.Point), x (Rectangle.x property), y (Rectangle.y property)
toString (Rectangle.toString method)
public toString() : String
Builds and returns a string that lists the horizontal and vertical positions and the width and
height of the Rectangle object.
Availability: ActionScript 1.0; Flash Player 8