# setFocus problem

**URL:** <https://forum.kirupa.com/t/setfocus-problem/155802>\
**Category:** flash\
**Created:** [July 20, 2005, 11:58am UTC](https://forum.kirupa.com/t/setfocus-problem/155802 "2005-07-20T11:58:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jest3r](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jest3r](https://forum.kirupa.com/u/jest3r)\
**Post date:** [July 20, 2005, 11:58am UTC](https://forum.kirupa.com/t/setfocus-problem/155802/1 "2005-07-20T11:58:11Z")

</div>

Hi,  
Ive created a form and it contains 12 input boxes (myMP1\_txt, myMP2\_txt etc…) and at the mo I’m using a short function for each input box to clear text when a user clicks in side the box (

\_root.myMP1\_txt.onSetFocus = function() {  
myMP1\_txt.text = “”;  
}

Can any one show me how to write some code so that i have only 1 function that can control the setFocus for all 12 boxes instead of 12 functions; 1 for each box?  
Thanks in advance
