EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Contains (Rectangle.contains Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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)

Table of Contents

Related product manuals