For example, if there are N points on the screen, we need to connect them with a line. If it is a straight line,
You can simply use moveTo and lineTo. But if it is a curve, for example, when we are drawing a chart,
What should I do if I need to connect N points using the besell curve?
If you think that graphics. curveTo can be used, it will be wrong, because it is difficult to calculate control points,
You cannot connect to a smooth curve.
Fortunately, there is also a third-party class library named cubicbeier, to see the effect of its completion:
Usage
Code
Import flash. display. MovieClip;
Import flash. geom. Point;
This. graphics. lineStyle (x, 1 );
Var points: Array = [];
For (var I: uint = 1; I <8; I ++)
{
Var m: MovieClip = this ["m" + I];
Points. push (new Point (m. x, m. y ));
}
Cubicbezr. curveThroughPoints (this. graphics, points );
Cubicbezr class
From: http://www.riameeting.com/node/731