# SetFocus

**URL:** <https://forum.kirupa.com/t/setfocus/186613>\
**Category:** Uncategorized\
**Created:** [April 22, 2006, 9:30pm UTC](https://forum.kirupa.com/t/setfocus/186613 "2006-04-22T21:30:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodman650](https://avatars.discourse-cdn.com/v4/letter/w/b9bd4f/32.png) [@woodman650](https://forum.kirupa.com/u/woodman650)\
**Post date:** [April 22, 2006, 9:30pm UTC](https://forum.kirupa.com/t/setfocus/186613/1 "2006-04-22T21:30:53Z")

</div>

Anyone know if there is a way to keep focused on input box even if you click somewhere else on stage? thanks!

---

<div class="post-metadata">

**Author:** ![watcher](https://avatars.discourse-cdn.com/v4/letter/w/77aa72/32.png) [@watcher](https://forum.kirupa.com/u/watcher)\
**Post date:** [April 22, 2006, 9:49pm UTC](https://forum.kirupa.com/t/setfocus/186613/2 "2006-04-22T21:49:15Z")

</div>

> [@woodman650](#):
>
> Anyone know if there is a way to keep focused on input box even if you click somewhere else on stage? thanks!

I guess you can define MouseListener

```auto
var oMouseListener:Object = new Object();

```

And each time there is a Mouse click

```auto
oMouseListener.onMouseDown = function() {
// reset you TF focus here
}
Mouse.addListener(oMouseListener);

```

inside your onMouseDown method, you can reset the focus for the textfield you like. As soon as you dont need the listener (because its triggered each time user presses a mouse button), use

```auto
Mouse.removeListener(oMouseListener);

```

to remove the listener…

Well, depends on what you want to achieve… don’t know perhaps there is more direct way to achieve the same… or better 😃

Hope it helped 😉
