Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > 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
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
Point (flash.geom.Point), x (Rectangle.x property), y (Rectangle.y property)
Flash CS3