Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Rectangle (flash.geom.Rectangle) > inflatePoint (Rectangle.inflatePoint method) | |||
public inflatePoint(pt:Point) : Void
Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method, except that it takes a Point object as a parameter.
The following two code examples give the same result:
rect1 = new flash.geom.Rectangle(0,0,2,5); rect1.inflate(2,2) rect1 = new flash.geom.Rectangle(0,0,2,5); pt1 = new flash.geom.Point(2,2); rect1.inflatePoint(pt1)
Availability: ActionScript 1.0; Flash Player 8
pt:Point - Increases the rectangle by the x and y coordinate values of the point.
The following example creates a Rectangle object and inflates it by the x (horizontal) and y (vertical) amounts found in a point.
import flash.geom.Rectangle; import flash.geom.Point; var rect:Rectangle = new Rectangle(0, 0, 2, 5); trace(rect.toString()); // (x=0, y=0, w=2, h=5 var myPoint:Point = new Point(2, 2); rect.inflatePoint(myPoint); trace(rect.toString()); // (x=-2, y=-2, w=6, h=9)
Flash CS3