I am trying to figure a way to calculate the area of a given part of an image. Basically the idea is to build an interface in flash where you can load an image as say a jpg or gif and feed the interface some basic parameters like the over all dimensions like 10x10 and give it a color value or take a color sample and have it calculate the area of the particular color like red for instance.

See sample image http://www.adlinda.com/sam.html

Im thinking this should be doable. Actually Im thinking it is simply a mater of counting pixels and calculating the percentage. Im not sure how I might access the total pixels of a given image or the total red pixels.