Director
Example
on mouseup
if member("alert text").text = 20 then
beep
else alert "wrong"
end if
--example using keyinput
if keypressed(49) then
beep
end if
Flash
Translation
on (release){
if alert text = = 20) {
thesound = new sound();
thesound.attachsound("beep.wav");
thesound.start();}
else{alert text="wrong"
}
}
//the above example requires you first
make a text box with its varible property set to "alert text". You will
also need a "beep.wav" in the library with its linkage property set to
"export to actionscript" (for the one below as well
//example using keyinput
if(Key.isDown(Key.SPACE)) {
thesound = new sound();
thesound.attachsound("beep.wav");
thesound.start();
} |