【问题标题】:Looping sound in AS3AS3 中的循环声音
【发布时间】: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


    【解决方案1】:

    使用mySound.play(0, int.MAX_VALUE);

    【讨论】:

      猜你喜欢
      • 2016-12-25
      • 2016-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-18
      相关资源
      最近更新 更多