Understanding the ActionScript Language > Using ActionScript syntax > Constants |  |

Constants

A constant is a property whose value never changes.

For example, the constants `BACKSPACE`, `ENTER`, `QUOTE`, `RETURN`, `SPACE`, and `TAB` are properties of the Key object and refer to keyboard keys. To test whether the user is pressing the Enter key, you could use the following statement:

    if(Key.getCode() == Key.ENTER) {
    	alert = "Are you ready to play?";
    	controlMC.gotoAndStop(5);
    }