I’m having a problem with AS3 and keyboard focus, and I’m wondering if there is a variable or a function I can use that will output to screen the name of the object that currently has keyboard focus?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You do it through the FocusManager. Then you can simply call the getFocus function. I put together a quick example that shows the current focus every second, really meaningless as it is, but it shows you how it works:
Just put this code in the root and then some input boxes on the stage and it should work. Also, check out the documentation