Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > Rectangle constructor | |||
Creates a new Rectangle object whose top-left corner is specified by the x and y parameters. If you call this constructor function without parameters, a rectangle with x, y, width, and height properties set to 0 is created.
Availability: ActionScript 1.0; Flash Player 8
x:Number - The x coordinate of the top-left corner of the rectangle.
y:Number - The y coordinate of the top-left corner of the rectangle.
width:Number - The width of the rectangle in pixels.
height:Number - The height of the rectangle in pixels.
The following example creates a Rectangle object with the specified parameters.
import flash.geom.Rectangle; var rect:Rectangle = new Rectangle(5, 10, 50, 100); trace(rect.toString()); // (x=5, y=10, w=50, h=100)
x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width property), height (Rectangle.height property)
Flash CS3