Keydown

This is a code that I have on a movie clip:

onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE)){
_root.acc = 2;
}else{
_root.acc = 10;
}
}

How do I make on key A - so you can press A instead of Space?

onClipEvent (enterFrame) {
	if (Key.isDown("A".charCodeAt(0))) {
		_root.acc = 2;
	} else {
		_root.acc = 10;
	}
}

http://livedocs.macromedia.com/flex/1/flex_docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flex_Documentation&file=appx_c_k.htm

What does charCodeAt(0) 0 the 0 stand for?

It means the 0th (or first) character in the string “A” (which is A).

For example:

“ABC”.charCodeAt(1) would provide the code for “B”.

You could also just use 65 (the ascii value of of upper-case A).