Javascript:: Is it possible to create an array of new audio objects? -


this example work :

var audio=new audio(); audio.src="hezi.mp3"; audio.play(); 

but wondering if there possibility create array of new audio objects such:

var audio[0]=new audio(); audio[0].src="hezi.mp3"; audio[0].play();  var audio[1]=new audio(); audio[1].src="gangina.mp3"; audio[1].play(); 

off-course second example not current syntax can idea...

you'd need adjust somewhat... plus don't want attempt play them @ once - , adding them dom allow give controls user.

var audio = [];  audio[0]=new audio(); audio[0].src="hezi.mp3"; audio[0].play();  audio[1]=new audio(); audio[1].src="gangina.mp3"; audio[1].play(); 

Comments