-1

Hi this is a first post for me:

Anyway I am building a video app to allow the user to add cue points dynamically when the user click the add cue button i have a container slide in from the right with some text fields on: Name: Time:, the user then presses enter to add it to a List control and to an XML file. While this container is visible the video is paused, This is where my problem is. If the user presses the space bar to have more than one word for the name of the cue point the video starts to play. I think I have to use the preventDefault() function but dont know how I would use it in this instance.

The container slides out from a MouseEvent so I can not put say if(e.KeyCode == SPACE) as its in a mouseEvent.

any7 help on doing this would be a great help

Thanks in advance

J

1 Answers1

0

You can try capturing key down events, but give your listener (fourth parameter in addEventListener()) a high priority, and then do preventDefault() and/or stopImmediatePropagation() on the event.

jpop
  • 1,094
  • 1
  • 7
  • 19
  • 1
    Taking this further, you'd want to add an event listener in the *capture* phase. ie, stage.addEventListener(KeyboardEvent.KEY_DOWN, onStageKeyDown, true); Then call preventDefault() and/or stopImmediatePropagation() and/or stopPropagation() if it's the space bar. – Nathan Oct 18 '13 at 17:33