size (Rectangle.size property)

public size : Point

The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.

Availability: ActionScript 1.0; Flash Player 8

Example

The following example creates a Rectangle object, retrieves its size (size), changes its size (size), and sets the new values on the Rectangle object. It is important to remember that the Point object used by the size property uses x and y values to represent the width and height properties of the Rectangle object.

import flash.geom.Rectangle;
import flash.geom.Point;

var rect:Rectangle = new Rectangle(1, 2, 4, 8);
var size:Point = rect.size;
trace(size.x); // 4;
trace(size.y); // 8;

size.x = 16;
size.y = 32;
rect.size = size;
trace(rect.x); // 1
trace(rect.y); // 2
trace(rect.width); // 16
trace(rect.height); // 32

See also

Point (flash.geom.Point)


Flash CS3