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

Actionscript 2.0 language reference
Table of Contents

Advertisement

trace(clonedRect.x); // 1
See also
x (Rectangle.x property)
,
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
- The x-value (horizontal position) of the point.
x:Number
- The y-value (vertical position) of the point.
y:Number
Returns
- If the specified point is contained in the Rectangle object, returns
Boolean
.
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)
,
y (Rectangle.y property)
,
width (Rectangle.width
true
Rectangle (flash.geom.Rectangle)
; otherwise
1037

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF