What I'm doing is keying footage in After Effects and then creating flash files for implementation in a SWF. I want to see if there is a way to crop the comp to just pixels around the action by our actors. Basically is there an auto sensing plug in or script to find the action of the keyed footage and then apply a sizing on the comp.
Once you have the min and max values, you can easily derive an absolute dimension by subtracting min from max. In your case you would want to refer the sampleImage() stuff to an adjustment layer, so it samples the entire comp width and height. Just apply the expression to a text layer to be able to read the values...