containsPoint (Rectangle.containsPoint method)
public containsPoint(pt:Point) : Boolean
Determines whether the specified point is contained within the rectangular region defined by
this Rectangle object. This method is similar to the
method, except
Rectangle.contains()
that it takes a Point object as a parameter.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The point, as represented by its x,y values.
pt:flash.geom.Point
Returns
- If the specified point is contained within this Rectangle object, returns
;
Boolean
true
otherwise
.
false
Example
The following example creates a Rectangle object and three Point objects, and tests whether
each of the points falls within the boundaries of the rectangle.
import flash.geom.Rectangle;
import flash.geom.Point;
var rect:Rectangle = new Rectangle(10, 10, 50, 50);
trace(rect.containsPoint(new Point(10, 10))); // true
trace(rect.containsPoint(new Point(59, 59))); // true
trace(rect.containsPoint(new Point(60, 60))); // false
See also
,
contains (Rectangle.contains method)
Point (flash.geom.Point)
containsRectangle (Rectangle.containsRectangle
method)
public containsRectangle(rect:Rectangle) : Boolean
Determines whether the Rectangle object specified by the
parameter is contained within
rect
this Rectangle object. A Rectangle object is said to contain another if the second Rectangle
object falls entirely within the boundaries of the first.
Availability: ActionScript 1.0; Flash Player 8
1038
ActionScript classes
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?