Art 412 - Director Key Press Demo - Stephen Wilson ****Revised ------------------------------ This routine checks if people have typed certain words into a field it assumes you have created a field member named "tester" it assumes you have made that field editable in the property inspector you attach this script to the member "tester" KeyDown checks if a key has been hit it calls subroutine that I wrote called keyhandler if you ask for 'the key', director tells you what key has been pressed in this example you are waiting for the return key (it assumes the person will type a word and then hit return) If the key = return, then it checks what is the word that was typed in member "tester" if it = yes it does one thing if it = no it does another thing if it = dirty words it does something else you could customize this to look for whatever words you wanted you could also customize it to go to a new section or whatever the example uses voicespeak to speak response the second part tests for what arrow key a person has typed it moves a sprite based on that arrow ------------------ on keyDown keyhandler end on keyhandler global yestotal, nototal t = the text of member "tester" if the key = return then if t = "yes" then voicespeak ("yes") yestotal = yestotal +1 put "" into member "tester" end if if t = "no" then voicespeak ("no") nototal = nototal +1 put "" into member "tester" end if if t = "damn" or t = "shit" then voicespeak ("don't type those words") put "" into member "tester" end if else pass end if end