【发布时间】:2017-01-02 15:13:19
【问题描述】:
在使用我的 Flash 程序时尝试循环播放背景音乐。
到目前为止,我的代码是这样的:
//turn off sound
btnOff.addEventListener(MouseEvent.CLICK, fl_stopsound);
function fl_stopsound(event:MouseEvent):void
{
SoundMixer.stopAll();
}
//turns sound on
btnOn.addEventListener(MouseEvent.CLICK, fl_ClickToPlayStopSound_1);
var fl_SC_1:SoundChannel;
//keeps track of whether the sound should be played or stopped
var fl_ToPlay_1:Boolean = true;
function fl_ClickToPlayStopSound_1(evt:MouseEvent):void
{
var mySound:Sound = new background();
mySound.play();
}
btnOff 关闭声音,btnOn 打开声音。我的配乐是 1:50 分钟长。是否可以使用这些按钮在程序中循环播放曲目?
干杯
【问题讨论】:
标签: actionscript-3 flash actionscript flash-cs6 flash-cc