Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you apply sound to a text input box? 1

Status
Not open for further replies.

BigBadDave

Programmer
May 31, 2001
1,069
EU
Hi all,
What I want to do is apply a sound to a letter e.g. a.wav to the letter A when the letter A is typed into an input text box. I got this to work when I made it into a button, but then when I typed the letter into the box only the sound played the letter didn't appear in the box.

Please can someone help me :)
 
What you might want to do is have a whole separate movieclip which holds the sound wave and plays when the keyboard's "a" is pressed. Try this:

Make a movie clip. On the first frame have an action to stop, and on the second frame have the action go to and stop frame 1. On another layer insert your sound into frame 2, and voila!


onClipEvent (keyDown) {
if (Key.isDown(65 )) {
play ();
}
}

Blended
 
One more thing do you know what all the keyboard letter numbers are (like # 65) e.g. a, b, c, d, e etc.
 
I think 65 is a, 66 is b, etc..., but look in appendix B of the manual (You can get it from macromedia in a pdf file if you don't have it anymore).

Blended
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top