non posso postare il tutto, sono un bel po' di files anche js, c'è dietro un bel po' di codice.. la funzione che interessa è questa, associata al gestore dell'evento OnKeyDown relativo al tasto 's'
codice:
function enable_sound(){
var players_exists = document.getElementById("player0");
if(players_exists == null){ //se non sono già stati creati gli embeds, li creo
var sound_control = document.getElementById("sound_control");
for(var i = 0; i < 4; i++){
var player_i = document.createElement("embed");
player_i.setAttribute("id", "player"+i);
player_i.setAttribute("src", "sound/theme"+i+".wav");
player_i.setAttribute("autostart", "false");
player_i.setAttribute("height", "0px");
player_i.setAttribute("width", "0px");
sound_control.appendChild(player_i);
//player_i.blur();
}
}
//self.focus();
//document.getElementById('game_area').focus();
}
eseguita quella funz, credo rimanga il focus sul tasto play di uno degli embeds, cosìcchè premendo INVIO parte il play invece della funzione gestore associata a INVIOù
EDIT: sound_control è un div, o uno span...