// Replace with your frame numbers
var intFirstFrame = 5;
var intLastFrame = 170;
// For calculation and display only
var intCounter = 0;
var strCounter = "0000";
_root.onEnterFrame = function() {
intCounter = Math.round(1000*(_currentframe-intFirstFrame)/
(intLastFrame-intFirstFrame));
if (intCounter < 0) {
intCounter = 0;
} else if (intCounter < 10) {
strCounter = "000" + intCounter;
} else if (intCounter < 100) {
strCounter = "00" + intCounter;
} else if (intCounter < 1000) {
strCounter = "0" + intCounter;
} else {
strCounter = "1000";
}
// The "trace" is just for testing. You have to create
// a dynamic text box which displays the variable "strCounter".
trace(strCounter + ": " + _currentframe);
};