Rectangle (flash.geom.Rectangle) 1049
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)
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 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...