03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See also<br />

Point (flash.geom.Point)<br />

containsPoint (Rectangle.containsPoint method)<br />

public containsPoint(pt:Point) : Boolean<br />

Determines whether the specified point is contained within the rectangular region defined by<br />

this Rectangle object. This method is similar to the Rectangle.contains() method, except<br />

that it takes a Point object as a parameter.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Parameters<br />

pt:Point - The point, as represented by its x,y values.<br />

Returns<br />

Boolean - If the specified point is contained within this Rectangle object, returns true;<br />

otherwise false.<br />

Example<br />

The following example creates a Rectangle object <strong>and</strong> three Point objects, <strong>and</strong> tests whether<br />

each of the points falls within the boundaries of the rectangle.<br />

import flash.geom.Rectangle;<br />

import flash.geom.Point;<br />

var rect:Rectangle = new Rectangle(10, 10, 50, 50);<br />

trace(rect.containsPoint(new Point(10, 10))); // true<br />

trace(rect.containsPoint(new Point(59, 59))); // true<br />

trace(rect.containsPoint(new Point(60, 60))); // false<br />

See also<br />

contains (Rectangle.contains method), Point (flash.geom.Point)<br />

containsRectangle (Rectangle.containsRectangle<br />

method)<br />

public containsRectangle(rect:Rectangle) : Boolean<br />

Determines whether the Rectangle object specified by the rect parameter is contained within<br />

this Rectangle object. A Rectangle object is said to contain another if the second Rectangle<br />

object falls entirely within the boundaries of the first.<br />

1052 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!