width (Rectangle.width property)

public width : Number

The width of the rectangle in pixels. Changing the value of the width property of a Rectangle object has no effect on the x, y, and height properties.



Availability: ActionScript 1.0; Flash Player 8

Example

The following example creates a Rectangle object and change its width property from 10 to 20. Notice that rect.right also changes.

import flash.geom.Rectangle;

var rect:Rectangle = new Rectangle(5, 5, 10, 10);
trace(rect.width); // 10
trace(rect.right); // 15

rect.width = 20;
trace(rect.width); // 20
trace(rect.right); // 25

See also

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


Flash CS3