Macromedia FlashFrame Based Auto Increment (Flash 5) +
ActionScript for Flash MX
// 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);
};
© 1998-2008
Martin Vögeli. Für Inhalte und Links werden keine Verantwortung
übernommen. |