Check the average brightness of a MovieClip (ignoring transparency)?
===

I'm working on a Flash app that will display MovieClips made from various PNGs with transparency. The PNGs need to be color-corrected at runtime to be uniform in brightness level. To accomplish this I've written code that uses the average brightness level of the MovieClip to determine how much to lighten or darken the image. Someone graciously gave me code to calculate the average brightness over at the Adobe forums: http://forums.adobe.com/message/3501572

This method, using the histogram, works perfectly, except when the MovieClip has transparent areas. Any transparent pixel in the MovieClip reads as pure white and skews the result.

Does anyone know a better way to do this? I need an accurate result; I remember trying wacky things like scaling the MovieClip down to 1 pixel and reading the color of that pixel, but that wasn't effective.