pwesthead
07-23-2009, 04:40 PM
Hi i have a piece if javascript code which pulls random numbers from 1 to 90 and a piece of text so if number 1 is pulled it will show text kellys eye and so on. I have this working fine, but what i want to do now is play a mp3 file when a number 1 is pulled randomley it will play 1.mp3 and 80 will play 80.mp3and so on, i have downloaded soundmanger2 to play the files, but im not sure how to write the java code so the mp3 playes with the number pulled,
here is some of the code
function initialiseBingoPool() {
bingoPool = new Array;
for (var i = 0; i < 90; i++) {
bingoPool.push(i + 1);
}
easynet4u(bingoPool);
}
function initialiseBingoPhrase() {
bingoPhrase = new Array;
bingoPhrase[1] = "Kelly's eye";
bingoPhrase[2] = "One little duck";
bingoPhrase[3] = "Cup of tea";
and so on until 90
function callNewNumber() {
if (!(newNumber = bingoPool.pop())) {
window.location.href = 'delete.php?number=' + newNumber;
}
ajax_request();
// Update the current number display with the new number and phrase
document.getElementById("latestNumber").firstChild.data = newNumber;
document.getElementById("bingoPhrase").firstChild.data = bingoPhrase[newNumber];
setTimeout(callNewNumber,4000);
so how would i write some java code to play mp3 as well as the bingo numbers and bingo phrase
im using soundmanager2 to play the mp3 just need some help with the coding
thanks paul
here is some of the code
function initialiseBingoPool() {
bingoPool = new Array;
for (var i = 0; i < 90; i++) {
bingoPool.push(i + 1);
}
easynet4u(bingoPool);
}
function initialiseBingoPhrase() {
bingoPhrase = new Array;
bingoPhrase[1] = "Kelly's eye";
bingoPhrase[2] = "One little duck";
bingoPhrase[3] = "Cup of tea";
and so on until 90
function callNewNumber() {
if (!(newNumber = bingoPool.pop())) {
window.location.href = 'delete.php?number=' + newNumber;
}
ajax_request();
// Update the current number display with the new number and phrase
document.getElementById("latestNumber").firstChild.data = newNumber;
document.getElementById("bingoPhrase").firstChild.data = bingoPhrase[newNumber];
setTimeout(callNewNumber,4000);
so how would i write some java code to play mp3 as well as the bingo numbers and bingo phrase
im using soundmanager2 to play the mp3 just need some help with the coding
thanks paul