i have the following code in the function init, and init is called, but when i load the webpage, no music is played. What am i missing? The mp3 files are in the same folder as the code.
“`
var numberOfSongs = 6
var sound = new Array(numberOfSongs+1)
sound[0]= “wen.mp3”
sound[1]= “wen.mp3”
sound[2]= “wen.mp3”
sound[3]= “wen.mp3”
sound[4]= “wen.mp3”
sound[5]= “wen.mp3”
function randomNumber(){
var randomLooper = -1
while (randomLooper < 0 || randomLooper > numberOfSongs || isNaN(randomLooper)){ randomLooper = parseInt(Math.random()*(numberOfSongs+1))
}
return randomLooper
}
var randomsub = randomNumber()
var soundFile = sound[randomsub]
document.write (‘<EMBED src= “‘ + soundFile + ‘” hidden=true type=”audio/mpeg” autostart=true loop=true>’)