Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > offsetPoint (Rectangle.offsetPoint method) | |||
public offsetPoint(pt:Point) : Void
Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.
Availability: ActionScript 1.0; Flash Player 8
pt:Point - A Point object to use to offset this Rectangle object.
The following example offsets a Rectangle by using the values found in a point.
import flash.geom.Rectangle;
import flash.geom.Point;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.toString()); // (x=1, y=2, w=4, h=8)
var myPoint:Point = new Point(16, 32);
rect.offsetPoint(myPoint);
trace(rect.toString()); // (x=17, y=34, w=4, h=8)
Flash CS3