# Problem with focus and keyPress

**URL:** <https://forum.kirupa.com/t/problem-with-focus-and-keypress/151989>\
**Category:** flash\
**Created:** [June 20, 2005, 11:17am UTC](https://forum.kirupa.com/t/problem-with-focus-and-keypress/151989 "2005-06-20T11:17:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuXo](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@LuXo](https://forum.kirupa.com/u/LuXo)\
**Post date:** [June 20, 2005, 11:17am UTC](https://forum.kirupa.com/t/problem-with-focus-and-keypress/151989/1 "2005-06-20T11:17:58Z")

</div>

Hi,  
I’ve two problems as follows: a movie plays until there is a text input, where a user have to enter a password. If the password is 1234, than the movie goes on. I want to focus the input box, so the cursor blinks when the movie stops, so the user knows where to type the code. I’ve tried with Selection.setFocus(\_root.inputboks) with no luck ☹

Other problem is that keyPress \<“Enter”\> is ignored. It ony will work with mouseclick…?

Here is my code from the button.

on(release, keyPress “\<Enter\>”)  
{  
if(inputboks.text == “1234”)  
{  
gotoAndPlay(18);  
video\_movie.gotoAndPlay(4);  
}  
else  
{  
wrongcode.text = “Wrong password…”;  
}  
}

Regards  
Luxo
