當前位置:編程學習大全網 - 網站源碼 - 怎麽讓自己做的flash播放器循環播放音樂?

怎麽讓自己做的flash播放器循環播放音樂?

使用數組進行操作。代碼如下

temp = 1;//音樂序號

function aa() {

mysound = new Sound();

mymusic_array = new Array("E:/music/夏天的風.mp3", "E:/music/鏗鏘玫瑰.mp3", "E:/music/芙蓉姐姐.mp3", "E:/music/海盜.mp3");

mysound.loadSound(mymusic_array[temp-1], false);

mysound.onLoad = function(success) {

if (success == true) {

mysound.start();

}

};

mysound.onSoundComplete = function() {

temp++;

if (temp>4) {//如果妳設置了10首音樂,就把4改成10

temp = 1;

}

aa();

};

myarray = new Array("夏天的風-溫嵐", "鏗鏘玫瑰", "芙蓉姐姐", "海盜");//歌曲名字數組

music_name = myarray[temp-1];//輸出歌曲名字

aa();

stop();

  • 上一篇:微信小程序openid可以用來加好友嗎
  • 下一篇:有哪些免費簡單的數據展示(數據可視化)網站?
  • copyright 2024編程學習大全網