The method used to mask and show the various segments is based on a single mask and a double set of 180-degree segments, which are each rotated as required. See below for a few images displaying the layering of the segments done by the AS code using attachMovie() for the segments and SwapDepths() for the mask.
Note that the mask has the highest 'depth' level, the first segment in the 'first half' of the pie chart has the next highest 'depth' level and so on. A second set of segments is positioned below the masked segments: this second set is used to display segments (or parts thereof) in the 'second half' of the pie chart.
Fig. 1 - the mask layer (MaskMC) and the two sets of segments, stored in the 'H1Arr' and 'H2Arr' array in the AS code respectively.
Fig. 2 - the situation after masking has been applied: by appropriately rotating the segments in the first set, the displayed segment parts are formed by the 180-degree mask.
Fig. 3 - this is what remains of the two sets of segments. This image shows the layering, while the next shows the resulting view.
Fig. 4 - Now this is what the user will see: a cute pie chart.
Note that the red segment crosses the 180-degree boundary and as such will have part of itself shown in the 'first half' (0 ... 180 degrees part) of the pie chart, while another segment is used to show the remainder in the 'second half' (180 ... 360 degrees) of the pie chart. The user does not see this little trick happening, yet the AS code takes care of this special condition.