使用as2在flash中暂停声音
我将在暂停按钮中使用此 as2,
on (press) {
if (pause!=true) {
playing=false;
paused=true;
stopped=false
myConditionText="Paused";
myMusicPosition=_root.my_sound.position/10000;
_root.my_sound.stop("sound1");
}
}
但是当我只播放声音 1 次时,
我想循环播放此声音,如何循环播放此声音...
请帮助我。
按暂停按钮,如下所示:
on (press) {
if (playing!=true) {
playing=true;
paused=false;
stopped=false
myConditionText="Playing";
_root.my_sound.start(myMusicPosition,0);
}
_root.my_sound.onSoundComplete = function() {
_root.myCondition.textColor = 0x00FF00;
myConditionText="Completed";
}
}
i'll using this as2 in the pause button
on (press) {
if (pause!=true) {
playing=false;
paused=true;
stopped=false
myConditionText="Paused";
myMusicPosition=_root.my_sound.position/10000;
_root.my_sound.stop("sound1");
}
}
but whn i play the sound it only 1 time
i want to loop this sound how can i loop this sound...
please help me.
on pause button as is:
on (press) {
if (playing!=true) {
playing=true;
paused=false;
stopped=false
myConditionText="Playing";
_root.my_sound.start(myMusicPosition,0);
}
_root.my_sound.onSoundComplete = function() {
_root.myCondition.textColor = 0x00FF00;
myConditionText="Completed";
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在调用 时指定循环次数
sound.start()
。或者聆听onSoundComplete
(就像您已经做的那样)并重新开始声音。You can specify a number of loops when calling
sound.start()
. Or listen for theonSoundComplete
(like you already do) and just start the sound over.