User Guide
Rectangle (flash.geom.Rectangle) 1037
trace(clonedRect.x); // 1
See also
x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width
property)
, height (Rectangle.height property)
contains (Rectangle.contains method)
public contains(x:Number, y:Number) : Boolean
Determines whether the specified point is contained within the rectangular region defined by
this Rectangle object.
Availability: ActionScript 1.0; Flash Player 8
Parameters
x:Number - The x-value (horizontal position) of the point.
y:Number - The y-value (vertical position) of the point.
Returns
Boolean - If the specified point is contained in the Rectangle object, returns true; otherwise
false.
Example
The following example creates a Rectangle object and tests whether each of three coordinate
pairs falls within its boundaries.
import flash.geom.Rectangle;
var rect:Rectangle = new Rectangle(10, 10, 50, 50);
trace(rect.contains(59, 59)); // true
trace(rect.contains(10, 10)); // true
trace(rect.contains(60, 60)); // false
See also
Point (flash.geom.Point)