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

Parameters

pt:Point - Increases the rectangle by the x and y coordinate values of the point.

Example

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)

See also

Point (flash.geom.Point)


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/00002085.html