Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/01/2011, 07:45
Avatar de Manuellama
Manuellama
 
Fecha de Ingreso: noviembre-2006
Ubicación: Zafra, Extremadura, Spain, Spain
Mensajes: 174
Antigüedad: 17 años, 5 meses
Puntos: 10
Respuesta: habilitar/deshabilitar teclado AS2

keylistener = new Object();
keylistener.onKeyDown = function() {
if (Key.getCode() == Key.RIGHT) {
//funciones derecha
trace("derecha");
}
if (Key.getCode() == Key.LEFT) {
//funciones izquierda
trace("izquierda");
}
if (Key.getCode() == Key.UP) {
//aqui intento inhabilitar el teclado así:
Key.removeListener(keylistener);
trace("arriba");
//pero nada...
}
}
space = new Object();
space.onKeyDown = function () {
if (Key.getCode()== Key.SPACE){
Key.addListener(keylistener);
}}
;
Key.addListener(keylistener);
Key.addListener(space);