stop();
var my_sound:Sound = new Sound();
my_sound.attachSound("dazi.mp3")
my_sound.start()
var id:Number = setInterval(dazi, 100);
var i:Number = 0;
var my_fmt:TextFormat = new TextFormat();
var my_str:String = "再别康桥——徐志摩"+newline+newline+"轻轻的我走了,"+newline+"正如我轻轻的来;"+newline+"我轻轻的招手,"+newline+"作别西天的云彩。";
this.createTextField("my_txt", 1, 100, 40, 120, 20);
my_txt.autoSize = true;
my_fmt.leading = 6;
my_fmt.color = 0x000000;
my_txt.setNewTextFormat(my_fmt);
function dazi() {
if (i<=length(my_str)) {
i++;
my_txt.text =my_str.substr(0, i-1);
}
if (i>length(my_str)) {
my_sound.stop()
clearInterval(id);
setTimeout(function () {
i = 0;
my_txt.text = "";
id = setInterval(dazi, 100);
}, 5000);
}
}
————————————————————————————————————————————————
最后几行的:
}, 5000);
这是什么意思?
