AS3 Percentage Between Min and Max
function percentage( X:Number, minValue:Number, maxValue:Number ):Number { return (X - minValue)/(maxValue - minValue) * 100; }