flash as 打字效果
时间:2010-11-18 来源:姚姚
第一帧as
//fscommand("allowscale","false");
_root.onLoad = function()
{ //在AS2.0中使用变量之前要先定义
_root.createTextField("wenzi", 1, 100, 100, 200, 270);
_root.wenzi.border = true;//为创建的文本设置边框
i = 1;//初始化变量
}
第二帧as
a= "北风卷地白草折,胡天八月即飞雪。\r\n忽如一夜春风来";
//上面是将要用打字效果实现的文字附给一字符串变量,也就是将这些文字看做字符串
len = a.length;
trace(i);
//取得字符串的长度
if (i<=len) {
//在字符串的字数范围内执行以下语句
_root.wenzi.text = a.substr(0, i);
//逐步截取字符从而实现打字效果
}
else
{
stop();
}
第三帧as
i=i+1
相关阅读 更多 +
排行榜 更多 +