equals (Point.equals method)

public equals(toCompare:Object) : Boolean

Determines whether two points are equal. Two points are equal if they have the same x and y values.

Availability: ActionScript 1.0; Flash Player 8

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

Flash CS3