Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We have an addition to the graphics drawing APIs in this release of AIR which allows simple creation of Cubic Bezier Curves without having to do a lot of complex equations on your own, each time you want to draw a new curve. The new cubicCurveTo() method takes six arguments to function correctly: a set of x and y coordinates for the first control point, a similar set for the second control point, and a set of coordinates for the anchor point.
Bezier curves are widely used in computer graphics to model smooth curves through the use of four distinct points: a start point, an end point, and two anchor points which inform the direction and pull of the drawn curve.
The curve will begin wherever the current line is – we can use the moveTo() method to precisely position the start point just as is done on other graphics API calls. The two control points influence the curve of the line, and the anchor point will be the end of the drawn curve. This is illustrated visually in Figure 1-1.