In the attached code sample, keyboard events just don't work.
The control never reaches handleKeyDown, no matter which key I press.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas creationComplete="initIt()" id="can1">
<mx:Label text="it's here" y="2000"/>
</mx:Canvas>
<mx:Script>
<![CDATA[
private function initIt():void {
can1.addEventListener(KeyboardEvent.KEY_DOWN,handleKeyDown);
}
private function handleKeyDown(e:KeyboardEvent):void {
if(e.keyCode == Keyboard.UP) {
trace("up");
verticalScrollPosition++;
}
if(e.keyCode == Keyboard.DOWN) {
trace("down");
verticalScrollPosition--;
}
}
]]>
</mx:Script>
</mx:Application>