Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > top (Rectangle.top property) | |||
public top : Number
The y coordinate of the top-left corner of the rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. However it does affect the height property; whereas changing the y value does not affect the height property.
The value of the top property is equal to the value of the y property.
Availability: ActionScript 1.0; Flash Player 8
This example changes the value of the top property from 0 to 10. Notice that rect.y also changes, as does rect.height:
import flash.geom.Rectangle; var rect:Rectangle = new Rectangle(0, 0, 100, 100); trace(rect.top); // 0 trace(rect.y); // 0 trace(rect.height); // 100 rect.top = 10; trace(rect.top); // 10 trace(rect.y); // 10 trace(rect.height); // 90
x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width property), height (Rectangle.height property)
Flash CS3