Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Point (flash.geom.Point) > clone (Point.clone method) | |||
public clone() : Point
Creates a copy of this Point object.
Availability: ActionScript 1.0; Flash Player 8
Point - The new Point object.
The following example creates a copy of the Point object called clonedPoint from the values found in the myPoint object. The clonedPoint object contains all of the values from myPoint, but it is not the same object.
import flash.geom.Point; var myPoint:Point = new Point(1, 2); var clonedPoint:Point = myPoint.clone(); trace(clonedPoint.x); // 1 trace(clonedPoint.y); // 2 trace(myPoint.equals(clonedPoint)); // true trace(myPoint === clonedPoint); // false
Flash CS3