Question
keyboard event listener
ok so I want my keyboard event listener to listen for the z
key. can you help me without changing my code to mutch? heres my
code. I simply want to switch the CONTROL with the letter z.. So
how hard is that. because i have been asking around on the internet
a while and havent received a good answer.
function detectText2(myevent:KeyboardEvent):void {
if (myevent.keyCode==Keyboard.SPACE) {
flash.media.SoundMixer.stopAll()
}
if (myevent.keyCode==Keyboard.CONTROL) {
var mySound:topsound=new topsound();
mySound.play();
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, detectText2);
function detectText2(myevent:KeyboardEvent):void {
if (myevent.keyCode==Keyboard.SPACE) {
flash.media.SoundMixer.stopAll()
}
if (myevent.keyCode==Keyboard.CONTROL) {
var mySound:topsound=new topsound();
mySound.play();
}
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, detectText2);