How do I fix this string error? This numberic counter works without the ADDITION STRING ARGUMENT. It's function is to add zero placeholders to the counter. It's close, but I need a second opinion.
COUNTER "all zeros, no count"
var timer:Timer = new Timer(10);
var count:int = 0; //start at -1 if you want the first decimal to be 0
var fcount:int = 0;
timer.addEventListener(TimerEvent.TIMER, incrementCounter);
timer.start();
function incrementCounter(event:TimerEvent) {
count++;
//
fcount=int(count*count/10000);//starts out slow... then speeds up
//
var whole_value:int = int(fcount / 100); //change value
var tenths:int = int(fcount / 10) % 10;
var hundredths:int = int(fcount) % 10;
//ADDITIONAL STRING ARGUMENTS FOR "ZERO PLACEHOLDER"
function formatCount(i:int):String {
var fraction:int = i % 100;
var whole:int = i / 100;
return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" : "") + fraction;
}
function test():void {
for (var i:int = 1; i<100000; i += 3) {
trace(i + " -> " + formatCount(i));
}
}
mytext.text = formatCount(whole_value + " : " + tenths + hundredths);
///////////////////END STRING ARGUMENT///////////////////
// mytext.text = whole_value + " : " + tenths + hundredths;
}
alt text http://www.ashcraftband.com/myspace/videodnd/icon-3.jpg
"thanks yal, hope to see the last of this problem, please help"