User Guide
1030 ActionScript classes
Rectangle (flash.geom.Rectangle)
Object
|
+-flash.geom.Rectangle
public class Rectangle
extends Object
The Rectangle class is used to create and modify Rectangle objects. A Rectangle object is an
area defined by its position, as indicated by its top-left corner point (x, y), and by its width
and its height. Be careful when you design these areas—if a rectangle is described as having its
upper-left corner at 0,0 and has a height of 10 and a width of 20, the lower-right corner is at
9,19, because the count of width and height began at 0,0.
The
x, y, width, and height properties of the Rectangle class are independent of each other;
changing the value of one property has no effect on the others. However, the
right and
bottom properties are integrally related to those four—if you change right, you are changing
width; if you change bottom, you are changing height, and so on. And you must have the
left or x property established before you set width or right property.
Rectangle objects are used to support the BitmapData class filters. They are also used in the
MovieClip.scrollRect property to support the ability to crop and scroll a MovieClip
instance with specific width, height and scrolling offsets.
Availability: ActionScript 1.0; Flash Player 8
See also
scrollRect (MovieClip.scrollRect property)
Property summary
Modifiers Property Description
bottom:Number The sum of the y and height properties.
bottomRight:Point The location of the Rectangle object's bottom-right
corner, determined by the values of the x and y
properties.
height:Number The height of the rectangle in pixels.
left:Number The x coordinate of the top-left corner of the
rectangle.
right:Number The sum of the x and width properties.