" til
4 Trykk " F9" for å åpne " Actions "-vinduet og sett inn følgende kode " playBtn . " : En
Var songClip : Sound = new Sound ();
Var answerClip : Lyd = new Sound ();
Var songInPlay ;
//deaktivere knapper
song0 . enabled = song1.enabled = song2.enabled = false;
playBtn.onRelease = function ( ) {
r = tilfeldig ( 3 ) ;
songInPlay = " sang " + r ;
songClip.attachSound ( songInPlay ) ;
songClip.start ();
//aktivere sang knapper
song0.enabled = song1 . enabled = song2.enabled = true;
trace ( songInPlay ) ;
}
song0.onRelease = song1.onRelease = song2.onRelease = function ( ) {
if ( songInPlay == this._name ) {
answerClip.attachSound ( " god ");
} else {
answerClip.attachSound ( " buzz ");
}
answerClip.start ();
//deaktivere knapper
song0.enabled = song1.enabled = song2.enabled = false; .
}
5
Velg "Control " og " Test Movie " fra toppmenyen for å teste spillet