Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > inflate (Rectangle.inflate method) | |||
Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.
Availability: ActionScript 1.0; Flash Player 8
dx:Number - The value to be added to the left and the right of the Rectangle object. The following equation is used to calculate the new width and position of the rectangle:
x -= dx; width += 2 * dx;
dy:Number - The value to be added to the top and the bottom of the Rectangle object. The following equation is used to calculate the new height and position of the rectangle.
y -= dy; height += 2 * dy;
The following example creates a Rectangle object and increases the value of its width property by 16 * 2 (32) and of its height property by 32 * 2 (64)
import flash.geom.Rectangle; var rect:Rectangle = new Rectangle(1, 2, 4, 8); trace(rect.toString()); // (x=1, y=2, w=4, h=8) rect.inflate(16, 32); trace(rect.toString()); // (x=-15, y=-30, w=36, h=72)
x (Rectangle.x property), y (Rectangle.y property)
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002084.html