# Selection.setFocus problem in Flash 8

**URL:** <https://forum.kirupa.com/t/selection-setfocus-problem-in-flash-8/279912>\
**Category:** flash\
**Created:** [January 20, 2009, 4:29pm UTC](https://forum.kirupa.com/t/selection-setfocus-problem-in-flash-8/279912 "2009-01-20T16:29:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daani](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Daani](https://forum.kirupa.com/u/Daani)\
**Post date:** [January 20, 2009, 4:29pm UTC](https://forum.kirupa.com/t/selection-setfocus-problem-in-flash-8/279912/1 "2009-01-20T16:29:48Z")

</div>

Hey all!  
I’m glad I found this forum cuz I’m having a problem with this.

I’ve made an input text box (var: password) and put this code inside a seperate MC:

onClipEvent (enterFrame){Selection.setFocus("\_root.password");  
Selection.setSelection(length(password), length(password));  
}

The problem is that after 9 letters or numbers have been typed in the input text box the “|” stops at the same spot in the text box and when trying to type another letter this get’s on the wrong side of the “|” and the more I write the more this gets pushed further to the right. Like this:

testingth|gnihtsi

Here I tried to write “testingthisthing”. As you can see after 9 letters it starts pushing the next thing I write to the right instead of leaving it behind and moving the “|”.

I hope someone could solve this, I’m not a very experienced programmer so don’t insult me or anything if this is very easy to solve.🙂

Thanks,  
Dan
