1 Reply Latest reply on Sep 6, 2006 6:10 PM by Craig Grummitt

    Keyboard Keys and Key Code values

    Matt-R Level 1
      Below is my code that zooms into a map when the user presses the SPACE bar. I want to change the SPACE bar to the + key. However the Key command seems to only have code hints for some keys (ie. SPACE, ENTER, LEFT, RIGHT etc).

      Does anyone know how I can change the action to zoom in using the + key. Hopefuly there is not a lot of code changes to make this happen.

      if(Key.isDown(Key.SPACE)){
      var cent = {x:m._x+m._width/2,y:m._y+m._height/2};
      var p = {x:m._x+m._width/2,y:m._y+m._height/2};
      _root.localToGlobal(p);
      map.globalToLocal(p);
      map._xscale += 50;
      map._yscale += 50;
      updateButtons();
      }