var interpolatedPoint:Point = Point.interpolate(point_1, point_2, .5);
trace(interpolatedPoint.toString()); // (x=-25, y=-25)
length (Point.length property)
public length : Number
The length of the line segment from (0,0) to this point.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example creates a Point object,
, and determines the length of a line
myPoint
from (0, 0) to that Point.
import flash.geom.Point;
var myPoint:Point = new Point(3,4);
trace(myPoint.length); // 5
See also
polar (Point.polar method)
normalize (Point.normalize method)
public normalize(length:Number) : Void
Scales the line segment between (0,0) and the current point to a set length.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The scaling value. For example, if the current point is (0,5), and you
length:Number
normalize it to 1, the point returned is at (0,1).
Example
The following example extends the length of the
object from 5 to 10.
normalizedPoint
import flash.geom.Point;
var normalizedPoint:Point = new Point(3, 4);
trace(normalizedPoint.length); // 5
trace(normalizedPoint.toString()); // (x=3, y=4)
normalizedPoint.normalize(10);
trace(normalizedPoint.length); // 10
trace(normalizedPoint.toString()); // (x=6, y=8)
1014
ActionScript classes
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?