Is there an existing javascript library for relaying key press events in the browser (or certain divs) into flash? I am hoping there might be a library kind of like this one for mousewheel events ?
Something like this handles javascript keyboard shortcuts great. I suppose I could just listen for those events and pass the ones I want into flash?
EDIT: These are great examples, however, if flash has focus, then javascript keystrokes are lost. How can you ensure that all key events go through javascript?
Here’s another example using jQuery. You can see some sort of demo here. It traces the keypresses from the browser to a textbox.
Your JavaScript would be
Inside the Flash movie, you would have the following code:
You’ll need to import jQuery in your html file and that’s about it. jQuery is cross-browser, so no problems should arise. Tested on Safari, Firefox and Opera (OSX).