EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Containspoint (Rectangle.containspoint Method); Containsrectangle (Rectangle.containsrectangle 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...
1038 ActionScript classes
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
Rectangle.contains() method, except
that it takes a Point object as a parameter.
Availability: ActionScript 1.0; Flash Player 8
Parameters
pt:flash.geom.Point - The point, as represented by its x,y values.
Returns
Boolean - If the specified point is contained within this Rectangle object, returns 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 rect parameter is contained within
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

Table of Contents

Related product manuals