Packagegraphics.geom
Classpublic class Rectangles
InheritanceRectangles Inheritance 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.

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.

To used this class with a FP8 and > with flash.display.BitmapData class and other flash.classes you can use the method toFlash() to return a compatible reference of this object.



Public Methods
 MethodDefined By
  
compare(rectangle1:Rectangle, rectangle2:Rectangle):int
[static] Compares its two arguments for order.
Rectangles
  
equals(rectangle1:Rectangle, rectangle2:Rectangle):Boolean
[static] Compares the specified Rectangle objects for equality.
Rectangles
  
getBottomLeft(rectangle:Rectangle):Point
[static] Returns the location of the Rectangle object's bottom-left corner, determined by the values of the x and y properties.
Rectangles
  
getCenter(rectangle:Rectangle):Point
[static] Returns the location of the Rectangle object's center, determined by the values of the x and y properties.
Rectangles
  
getTopRight(rectangle:Rectangle):Point
[static] Returns the location of the Rectangle object's top-right corner determined by the x and y values of the point.
Rectangles
  
setBottomLeft(rectangle:Rectangle, point:Point):void
[static] Sets the location of the Rectangle object's bottom-left corner, determined by the values of the x and y properties.
Rectangles
  
setCenter(rectangle:Rectangle, point:Point):void
[static] Sets the x and y coordinates of the top-left corner of the rectangle if the specified value in argument is the middle of the Rectangle.
Rectangles
  
setTopRight(rectangle:Rectangle, point:Point):void
[static] Sets the location of the Rectangle object's top-right corner determined by the x and y values of the point.
Rectangles
  
toObject(rectangle:Rectangle):Object
[static] Returns the Object representation of this object.
Rectangles
  
toSource(rectangle:Rectangle):String
[static] Returns the source code string representation of the object.
Rectangles
Method Detail
compare()method
public static function compare(rectangle1:Rectangle, rectangle2:Rectangle):int

Compares its two arguments for order.

Parameters

rectangle1:Rectangle — the first Rectangle to compare.
 
rectangle2:Rectangle — the second Rectangle to compare.

Returns
int

  • -1 if o1 is "lower" than (less than, before, etc.) o2 ;
  • 1 if o1 is "higher" than (greater than, after, etc.) o2 ;
  • 0 if o1 and o2 are equal.

  • Throws
    ClassCastError — the arguments of the method must be Rectangle reference.
    equals()method 
    public static function equals(rectangle1:Rectangle, rectangle2:Rectangle):Boolean

    Compares the specified Rectangle objects for equality.

    Parameters

    rectangle1:Rectangle
     
    rectangle2:Rectangle

    Returns
    Booleantrue if the the specified Rectangle objects are equals.
    getBottomLeft()method 
    public static function getBottomLeft(rectangle:Rectangle):Point

    Returns the location of the Rectangle object's bottom-left corner, determined by the values of the x and y properties.

    Parameters

    rectangle:Rectangle

    Returns
    Point — the location of the Rectangle object's bottom-left corner, determined by the values of the x and y properties.
    getCenter()method 
    public static function getCenter(rectangle:Rectangle):Point

    Returns the location of the Rectangle object's center, determined by the values of the x and y properties.

    Parameters

    rectangle:Rectangle

    Returns
    Point — the location of the Rectangle object's center, determined by the values of the x and y properties.
    getTopRight()method 
    public static function getTopRight(rectangle:Rectangle):Point

    Returns the location of the Rectangle object's top-right corner determined by the x and y values of the point.

    Parameters

    rectangle:Rectangle

    Returns
    Point — the location of the Rectangle object's top-right corner determined by the x and y values of the point.
    setBottomLeft()method 
    public static function setBottomLeft(rectangle:Rectangle, point:Point):void

    Sets the location of the Rectangle object's bottom-left corner, determined by the values of the x and y properties.

    Parameters

    rectangle:Rectangle
     
    point:Point

    setCenter()method 
    public static function setCenter(rectangle:Rectangle, point:Point):void

    Sets the x and y coordinates of the top-left corner of the rectangle if the specified value in argument is the middle of the Rectangle.

    Parameters

    rectangle:Rectangle
     
    point:Point

    setTopRight()method 
    public static function setTopRight(rectangle:Rectangle, point:Point):void

    Sets the location of the Rectangle object's top-right corner determined by the x and y values of the point.

    Parameters

    rectangle:Rectangle
     
    point:Point

    toObject()method 
    public static function toObject(rectangle:Rectangle):Object

    Returns the Object representation of this object.

    Parameters

    rectangle:Rectangle

    Returns
    Object — the Object representation of this object.
    toSource()method 
    public static function toSource(rectangle:Rectangle):String

    Returns the source code string representation of the object.

    Parameters

    rectangle:Rectangle

    Returns
    String — the source code string representation of the object.