最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个简单的字母顺序变化效果
时间:2022-07-02 17:22:26 编辑:袖梨 来源:一聚教程网
问:我设定一个动态文本框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;
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;
相关文章
- 无畏契约源能行动铁臂实战 实战技巧分享 07-12
- Dreamweaver怎么输入项目符号? dw项目符号的添加方法 07-12
- 燕云十六声瘦骨罗汉奇遇怎么过-瘦骨罗汉奇遇攻略 07-12
- Win11安装虚拟网卡怎么启用-图文步骤 07-12
- 使用PS结合LR制作出民国风格的复古人像照片教程 07-12
- 微信公众号怎么制作一个签到积分的功能 07-12