Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > offset (Rectangle.offset method) | |||
Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.
Availability: ActionScript 1.0; Flash Player 8
dx:Number - Moves the x value of the Rectangle object by this amount.
dy:Number - Moves the y value of the Rectangle object by this amount.
The following example creates a Rectangle object and offsets its x and y values by 5 and 10 respectively
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.offset(16, 32); trace(rect.toString()); // (x=17, y=34, w=4, h=8)
Flash CS3