Point (flash.geom.Point)
1013
Parameters
toCompare
:Object
- The point to be compared.
Returns
Boolean
- If the object is equal to this Point object,
true
; if it is not equal,
false
.
Example
The following example determines whether the values of one point are equal to the values of
another point. If the objects are the same,
equals()
does not return the same result that the
strict equality operator (
===
) does.
import flash.geom.Point;
var point_1:Point = new Point(1, 2);
var point_2:Point = new Point(1, 2);
var point_3:Point = new Point(4, 8);
trace(point_1.equals(point_2)); // true
trace(point_1.equals(point_3)); // false
trace(point_1 === point_2); // false
trace(point_1 === point_3); // false
interpolate (Point.interpolate method)
public static interpolate(pt1:Point, pt2:Point, f:Number) : Point
Determines a point between two specified points.
Availability:
ActionScript 1.0; Flash Player 8
Parameters
pt1
:flash.geom.Point
- The first point.
pt2
:flash.geom.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=0, pt1 is returned; if f=1, pt2 is returned.
Returns
flash.geom.Point
- The new, interpolated point.
Example
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);
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...