An application with only 2 controls

ComponentA is a multi-line text.
ComponentB is TextInput.

I capture PgUp/PgDn and scroll the component.
However, when focus on component B, PgUp/PgDn
will cause my cursor move to the end or beginning
of word together with scrolling. I want to scroll
without moving the cursor in textInput.

I try to use preventDefault() but not success

private function KeyDown(event:KeyboardEvent):void{
if (event.KeyCode == KEYBOARD.PAGEUP) {
 ...... scroll the page......
}
}

private function ComponentAKeyDown(event:KeyboardEvent):void{
if (event.KeyCode == KEYBOARD.PAGEUP) {
  event.preventDefault();
}
}

It works for other key, but not PgUp, PgDn !!

I try to override KeyDownHandler, not ok.

Any helps ?


Reply via email to