카운트 다운을 올바르게 설정하려면 어떻게해야합니까?카운트 다운을 올바르게 설정하십시오. as3
저는 33,000.00부터 0까지 세지 만, 유행에 따라 작동하지만 빼기 연산자가 텍스트 필드에 나타납니다. alt text http://www.ashcraftband.com/myspace/videodnd/nm___.jpg
예
나는, XML로 업데이트 할 수있는 업 카운터 나 다운 카운터 변수에 따라 할 뭔가가 필요
//Countdown from 33,000.00 to zero
var timer:Timer = new Timer(10);
var count:int = -3300000;
var fcount:int = 0;
timer.addEventListener(TimerEvent.TIMER, incrementCounter);
timer.start();
function incrementCounter(event:TimerEvent) {
count++;
fcount=int(count);
mytext.text = formatCount(fcount);
}
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 : fraction);
}
.
//Count up from 33,000.00
var countValue:int = 3300000;
count = countValue;
//Count down from 33,000.00
var countValue:int = -3300000;
count = countValue;
이것은 내가
fcount을 필요로하는 모든이 = Math.abs가
아직 학습 중입니다. var countValue를 어떻게 사용합니까? int = 3300000; –
fcount = Math.abs (개수); 감사합니다. –