【发布时间】:2010-02-12 19:11:47
【问题描述】:
根据我现在所拥有的,即“动态文本”计数,我该如何通过动画来改进它?我想要像里程表一样“滚动”,也想要像 LED 一样“滴答”。
我遇到问题的部分
一种。有不同图像的计数器推送数组“一半懂这个”
湾。需要动画作为对象我可以更改“LED 自动收报机、里程表滚动条”
C。实施“我很困惑”
alt text http://www.ashcraftband.com/myspace/videodnd/examp.jpg
//counter
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/1000);//starts out slow... then speeds up
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);
}
“感谢您的帮助”
alt text http://www.ashcraftband.com/myspace/videodnd/board2.jpg
【问题讨论】:
标签: flash actionscript-3