Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Taking input from keys without having to click mouse 1

Status
Not open for further replies.

NormRC

Programmer
Dec 5, 2001
2
0
0
GB
Hi I have written some script that allows me to control a flash movie using keys on a keyboard. I have used an invisible button to place the code in for the keys. The only problem is that you have to click the mouse on the movie before they will work. Anyone know how I can get round this?

Cheers

Norm
 
It could prolly have something to do with the focus. Using actionscript, see if you can set the focus on that invisable button or maybe set the onmouse event to true.
Todd Norris
Hope this helps !
 
I've come across this too while writing some online games and it's really frustrating.

The best solution I can come up with is this: always have a "start" button for your movie before control is handed over exclusively to the keyboard. This way the user has to click on the movie and therefore focus the window so that the keys will work.

If anyone has something better I'd love to hear it.
 
Your method is one... But this guy also demontrates the use of javascript to achieve the same result:


Enjoy!
wink4.gif
ldnewbie
 
I've run into this problem before. If you run the movie in a browser, the user must click in the movie in order to begin using the keyboard. My problem was worse because my users didn't even have a mouse. The only way to get around the mouse issue is to actually have the movie run in a projector. Then the user can start using the keyboard immediately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top