EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Isempty (Rectangle.isempty 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...
1044 ActionScript classes
Availability: ActionScript 1.0; Flash Player 8
Parameters
toIntersect:flash.geom.Rectangle - The Rectangle object to compare against this
Rectangle object.
Returns
Boolean - If the specified object intersects with this Rectangle object, returns true; otherwise
false.
Example
The following example determines whether
rectA intersects with rectB or rectC.
import flash.geom.Rectangle;
var rectA:Rectangle = new Rectangle(10, 10, 50, 50);
var rectB:Rectangle = new Rectangle(59, 59, 50, 50);
var rectC:Rectangle = new Rectangle(60, 60, 50, 50);
var rectAIntersectsB:Boolean = rectA.intersects(rectB);
var rectAIntersectsC:Boolean = rectA.intersects(rectC);
trace(rectAIntersectsB); // true
trace(rectAIntersectsC); // false
var firstPixel:Rectangle = new Rectangle(0, 0, 1, 1);
var adjacentPixel:Rectangle = new Rectangle(1, 1, 1, 1);
var pixelsIntersect:Boolean = firstPixel.intersects(adjacentPixel);
trace(pixelsIntersect); // false
See also
x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width
property)
, height (Rectangle.height property)
isEmpty (Rectangle.isEmpty method)
public isEmpty() : Boolean
Determines whether or not this Rectangle object is empty.
Availability: ActionScript 1.0; Flash Player 8
Returns
Boolean - If the Rectangle object's width or height is less than or equal to 0, returns true;
otherwise
false.

Table of Contents

Related product manuals