My code:
I understand that my for loop assigns all array elements to the variable pickSound and that is why I am left with it only playing the last element. So how can I get it to play each element in order and start over once done.
function show() {
var sounds = new Array(
"audio/basement.mp3",
"audio/roll.mp3",
"audio/gatorade.mp3",
"audio/half.mp3",
"audio/hotdogs.mp3",
"audio/keys.mp3",
"audio/heil.mp3",
"audio/money.mp3",
"audio/ours.mp3",
"audio/pass.mp3"
);
for (var i = 0; i < sounds.length; i++){
var pickSound = sounds[i];
}
$('#divOne').html("<embed src=\""+ pickSound +"\" hidden=\"true\" autostart=\"true\" />");
return false;
};