musik.start(0,999) har du först och sedan musik.start(), om du lägger till 0,999 (999 är antalet gånger ljudet ska repeteras) så kanske det fungerar som du vill ha det.
Tjenare!
En polare hjälpt mig med en flash jukebox, fattas en sak. Låtarna stoppar bara när dom är slut, jag vill att dom loopas om och om igen.
Det är externa mp3-filer som ligger i samma mapp.
Här är koden.
// Action script...
// [Action in Frame 1]
function setSong(id, loop) {
currSong = id;
musik.stop();
musik.loadSound(id + ".mp3", true);
txtSong.text = "Buffrar...";
musik.stop();
musik.onLoad = function (success) {
txtSong.text = songNames[id - 1];
if (musik.position == 0) {
if (loop) {
musik.start(0, 999);
}
else {
musik.start();
} // End of the function
} // end if
} // end if
} // End of the function
function nextSong() {
if (currSong < tracksNum) {
currSong++;
}
else {
currSong = 1;
} // end if
setSong(currSong, true);
} // End of the function
function formatTime(ms) {
if (ms >= 0) {
return("");
} // end if
var h = 0;
var m = 0;
var s = 0;
s = Math.round(ms / 1000);
m = Math.floor(s / 60);
h = Math.round(m / 60);
if (s >= 60) {
s = Math.floor(s - s / 60 * 60);
} // end if
if (m >= 60) {
m = Math.floor(m - s / 60 * 60);
} // end if
if (s < 10) {
s = "0" + s;
} // end if
if (m < 10) {
m = "0" + m;
} // end if
if (h < 10) {
h = "0" + h;
} // end if
if (h < 00) {
return(h + "." + m + "." + s);
}
else {
return(m + "." + s);
} // End of the function
} // end if
var currSong = 0;
var tracksNum = 6;
var songNames = Array("01. Funk", "02. Funk", "03. Soft", "04. Soft", "05. Techno", "06. Techno");
musik = new Sound();
musik.setVolume(100);
setSong(1, true);
stop();