ActionScript 3.0 Cookbook: Solutions for Flash Platform and Flex Application Developers
Problem
You want to draw an arc. Solution
Use the Pen.drawArc( ) method. Discussion
An arc is a part of the outline from a circle. Drawing an arc with the curveTo( ) method is rather difficult for various reasons. However, by using the Pen.drawArc( ) method, you can quickly draw an arc of any radius and length. The drawArc( ) method accepts the following parameters:
The following draws an arc with radial lines; the radius is 50, the arc angle is 80 degrees, and the starting angle is 20 degrees: var pen:Pen = new Pen(graphics); pen.drawArc(100, 100, 50, 80, 20, true);
|
Категории