Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > contains (Rectangle.contains method) | |||
Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.
Availability: ActionScript 1.0; Flash Player 8
x:Number - The x-value (horizontal position) of the point.
y:Number - The y-value (vertical position) of the point.
Boolean - If the specified point is contained in the Rectangle object, returns true; otherwise false.
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
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002079.html