Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > 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
scrollRect (MovieClip.scrollRect property)
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
bottom |
The sum of the |
|
|
bottomRight |
The location of the Rectangle object's bottom-right corner, determined by the values of the |
|
|
height |
The height of the rectangle in pixels. |
|
|
left |
The x coordinate of the top-left corner of the rectangle. |
|
|
right |
The sum of the |
|
|
size |
The size of the Rectangle object, expressed as a Point object with the values of the |
|
|
top |
The y coordinate of the top-left corner of the rectangle. |
|
|
topLeft |
The location of the Rectangle object's top-left corner determined by the x and y values of the point. |
|
|
width |
The width of the rectangle in pixels. |
|
|
x |
The x coordinate of the top-left corner of the rectangle. |
|
|
y |
The y coordinate of the top-left corner of the rectangle. |
Properties inherited from class Object
|
Signature |
Description |
|---|---|
|
Rectangle |
Creates a new Rectangle object whose top-left corner is specified by the |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
clone |
Returns a new Rectangle object with the same values for the |
|
|
contains |
Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. |
|
|
containsPoint |
Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. |
|
|
containsRectangle |
Determines whether the Rectangle object specified by the |
|
|
equals |
Determines whether the object specified in the |
|
|
inflate |
Increases the size of the Rectangle object by the specified amounts. |
|
|
inflatePoint |
Increases the size of the Rectangle object. |
|
|
intersection |
If the Rectangle object specified in the |
|
|
intersects |
Determines whether the object specified in the |
|
|
isEmpty |
Determines whether or not this Rectangle object is empty. |
|
|
offset |
Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts. |
|
|
offsetPoint |
Adjusts the location of the Rectangle object using a Point object as a parameter. |
|
|
setEmpty |
Sets all of the Rectangle object's properties to 0. |
|
|
toString |
Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object. |
|
|
union |
Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles. |
Methods inherited from class Object addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002618.html