Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Point (flash.geom.Point) > interpolate (Point.interpolate method) | |||
Determines a point between two specified points. The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer parameter f is to 1.0, the closer the interpolated point will be to the first point (parameter pt1). The closer parameter f is to 0, the closer the interpolated point will be to the second point (parameter pt2).
Availability: ActionScript 1.0; Flash Player 8
pt1:Point - The first point.
pt2:Point - The second point.
f:Number - The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.
Point - The new, interpolated point.
The following example locates the interpolated point (interpolatedPoint) half way (50%) between point_1 and point_2.
import flash.geom.Point; var point_1:Point = new Point(-100, -100); var point_2:Point = new Point(50, 50); var interpolatedPoint:Point = Point.interpolate(point_1, point_2, 0.5); trace(interpolatedPoint.toString()); // (x=-25, y=-25)
Flash CS3