4 Premere " F9 " per aprire la finestra " Azioni " e inserire il seguente codice " playBtn . " :
Var songClip : sound = new Sound ( ) ;
var answerClip : sound = new Sound ( ) ;
songInPlay var ;
//disabilitare i pulsanti
song0 . enabled = song1.enabled = song2.enabled = false;
playBtn.onRelease = function () {
r = random ( 3) ;
songInPlay = " canzone " + r ;
songClip.attachSound ( songInPlay ) ;
songClip.start ();
//abilitare pulsanti SONG
song0.enabled = song1 . enabled = song2.enabled = true ;
traccia
( songInPlay ) ;
}
song0.onRelease = song1.onRelease = song2.onRelease = function ( ) {
se ( songInPlay == this._name ) {
answerClip.attachSound ( "grande" ) ;
} else {
answerClip.attachSound ( " buzz " ) ; }
answerClip.start ();
//disabilitare i pulsanti
song0.enabled = song1.enabled = song2.enabled = false; .
}
5
Scegli "Controllo" e " prova filmato " dal menu in alto per testare il gioco