如何使用计数器触发精灵?需要一个例子或想法来工作。
我希望数字值加载精灵。计数器的值转到文本字段。我希望每个数字值都有一个“if”条件来播放相应数字的精灵。
替代文字 http://www.ashcraftband.com/myspace/videodnd/icon_7.jpg
愚蠢的例子
//计数器在文本字段中播放图片而不是播放数字
详细示例
//如果大于 0 且小于 2,则播放 1 ==> ONE DISPLAYS ON SCREEN
比较
- 变量数据显示“像 Flash 音乐可视化”
- 数据是一个计数器
它是如何工作
的 -loaders 从计数器
-9 目标“9 个数字空间”接收数字值 -
添加和删除子
项 -允许计数器看起来像任何东西
替代文字 http://www.ashcraftband.com/myspace/videodnd/icon-3.jpg
我想使用的计数器
//"counts to a million with two decimal places" <br>
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
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);
}