Creating the Slice
Step 1 : Creating the Slice Movie Clip
As shown in the screenshot above, 3 symbols are needed for this example; they are all movieclips. One is pieslice, which is that skinny blue sliver in the middle of the screen. It's 1/100th of a circle (3.6 degrees) and will be duplicated x times to represent x percent. You can create it by drawing a circle, bisecting it with a line, then bisecting with another line the same as the first but rotated 3.6 degrees counterclockwise and taking the resulting segment as your pie slice. It needed some fiddling before I got an acceptable slice; so alternately you can just open the example fla and drag a copy into your movie from the library.
Place it so that the pointed end is where you want the center of the pie chart to be and use the Instance panel to assign it an instance name of mcPie (I use "mc" at the beginning of every movieclip instance to remind me that that's what it is. Likewise, n means a number, s means string, and so forth). That blue sliver will be part of the first segment of the chart.
|» Level Advanced|
Rating: 7 Votes: 79
|Helen Triolo started i-Technica, a web design shop in the Washington DC area, three years ago, after being an apps engineer for a Silicon Valley company and then a programmer for an uncountable number of years. She's been hooked on Flash since buying a copy last January.|
|Download the files used in this tutorial.|
|Download (13 kb)|
|More help? Search our boards for quick answers!|