setEmpty (Rectangle.setEmpty method)

public setEmpty() : Void

Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0.

This method sets the values of the x, y, width, and height properties to 0.

Availability: ActionScript 1.0; Flash Player 8

Example

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

import flash.geom.Rectangle;

var rect:Rectangle = new Rectangle(5, 10, 50, 100);
trace(rect.isEmpty()); // false
rect.setEmpty();
trace(rect.isEmpty()); // true

See also

x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width property), height (Rectangle.height property)


Flash CS3