# AS trouble

**URL:** <https://forum.kirupa.com/t/as-trouble/33109>\
**Category:** flash\
**Created:** [October 15, 2003, 11:35am UTC](https://forum.kirupa.com/t/as-trouble/33109 "2003-10-15T11:35:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooler](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mooler](https://forum.kirupa.com/u/mooler)\
**Post date:** [October 15, 2003, 11:35am UTC](https://forum.kirupa.com/t/as-trouble/33109/1 "2003-10-15T11:35:40Z")

</div>

Hi I´m attaching my \*.rar with the fla.

I´m making a simple login fla wich I+ve done before. Using this code on the button that checks that the right password is used.  
[AS]  
on (press, keyPress “\<Enter\>”) {  
if ((password == “whatever”)) {  
gotoAndStop(“index”, 1);  
} else {  
gotoAndStop(“wrong”);  
}  
}  
[/AS]

The problem is that when using Enter you won´t get logged in but the cursor just focus to the textbox?

Using the Selection.setFocus command in the first frame

[AS]Selection.setFocus(login\_txt);[/AS]

And I think the problem might be there somewhere… but I´m so locked on this problem that I can´t figure out where I´ve gone wrong.  
Please help me.:nerd:
