Sunday, May 4, 2008

Update on detecting keys script


Hey Bec

just a quick note letting you know  that we actually have the button dectection script in AS3 :P and it wont work in main fla file, oh funs!! Good news is I've got to to AS2 now and it sems to be quite happy. Here is the script:

keylistener = new Object();
keylistener.onKeyDown = function() {
if (Key.getCode() == 49) {
trace("1 chaosButton()");
}
if (Key.getCode() == 52) {
trace("4 rainButton()");
}
if (Key.getCode() == 54) {
trace("6 dayButton()");
}
if (Key.getCode() == 56) {
trace("8 nightButton()");
}
if (Key.getCode() == 68) {
trace("d fluffyButton()");
}
if (Key.getCode() == 73) {
trace("i woolButton())");
}
if (Key.getCode() == 76) {
trace("l cushyButton()");
}
if (Key.getCode() == 77) {
trace("m clearButton()");
}
if (Key.getCode() == 80) {
trace("p birdButton()");
}
if (Key.getCode() == 86) {
trace("v sandpaperButton()");
}
if (Key.getCode() == 87) {
trace("w volUp()");
}
if (Key.getCode() == 88) {
trace("x volDown()");
}
}
Key.addListener(keylistener);

Gave to Michael to have alook at it, so hopefully he will make improvments/suggestions

okay..had enough of this BS, nites!


No comments: