This content has been marked as final. Show 7 replies
I suspect the issue you are having is one of focus. The onKeyDown event is only triggered when you click enter AND have focus on the TextArea. You might want to add a more universally-triggered event like a keyDown on the application object. There's more info about this sort of thing here:
Maybe you also need to call event.preventDefault() to stop the default behavior of the enter key.
I have a file with 2 panels and some popups in a fairly layout I would like to change the focus to a different screen on a mouse click in another the screen. The only way I can do it now is to click on the scroll bar for the screen. Is it possible to do this by using a mouse click in the particular screen?
Please do not "hijack" threads.
If your post does not apply directly to another post in the thread (yours does not), create a new subject. Use a descriptive subject for best response.
@danger42,I reviewed the adobe docs and ran some tests; it appears to be not related to the focus, though I am not sure.
@ntsiii, the event is not cancelable, and therefore I am unable to preventDefault() the behavior.
Thank you both for your suggestions and I will continue to work on this.
I resolved the problem and I am still not sure completely as to why this problem was resolved by new tactic, but it works now.
I changed the event from keyDwon to KeyUp (Java used to have some issues with this kinda thing) and it worked. Thanks to everyone. Cheers
I got your code to work on the ENTER key press by making some changes.
1) Check for keyDown, not Keyboard.ENTER. (In the text area, of course)
2) Validating the textArea component after you programmatically change its value.
Keep in mind that other events are being thrown when you type into a text area, but not when you click the button.
Note: I would also recommend not using "textArea" as the id for a textArea. It works, but you are asking for trouble by using a class name here.