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.

Example

The following example creates an empty Rectangle object and verifies that it is empty.

import flash.geom.*;
var rect:Rectangle = new Rectangle(1, 2, 0, 0);
trace(rect.toString()); // (x=1, y=2, w=0, h=0)
trace(rect.isEmpty()); // true

The following example creates a non-empty Rectangle and makes it become empty.

import flash.geom.Rectangle;

var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.isEmpty()); // false
rect.width = 0;
trace(rect.isEmpty()); // true
rect.width = 4;
trace(rect.isEmpty()); // false
rect.height = 0;
trace(rect.isEmpty()); // true

Flash CS3