Rectangle (flash.geom.Rectangle) 1045
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
left (Rectangle.left property)
public left : Number
The
x
coordinate of the top-left corner of the rectangle. Changing the
x
value of a Rectangle
object has no effect on the
y
,
width
, and
height
properties.
The
left
property is equal to the
x
property.
Availability:
ActionScript 1.0; Flash Player 8
Example
The following example changes the
left
property from 0 to 10. Notice that
rect.x
also
changes.
import flash.geom.Rectangle;
var rect:Rectangle = new Rectangle();
trace(rect.left); // 0
trace(rect.x); // 0
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...