问:我设定一个动态文本框var=zimu,我想让它不停的按顺序显示A-Z 26个字母,然后当显示到指定"T"时,则停止下来。这个效果用AS怎么写啊?
(终极讨厌)答:占位,用数组!看效果先:
代码如下:
var abc_array:Array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
var _fmt:TextFormat = new TextFormat();
var n:Number = 0;
function out_func() {
onEnterFrame = function () {
_fmt.color = Math.random()*0xffffff;
_fmt.size = 50+Math.random()*20;
_txt.setNewTextFormat(_fmt);
_txt.text = abc_array[n];
_txt.text == "T" ? delete onEnterFrame : 终极讨厌;
n++;
n %= abc_array.length;
};
}
out_func();
_btn.onRelease = out_func;