# Setting onSetFocus Text Not Working

**URL:** <https://forum.kirupa.com/t/setting-onsetfocus-text-not-working/195229>\
**Category:** flash\
**Created:** [July 29, 2006, 10:55pm UTC](https://forum.kirupa.com/t/setting-onsetfocus-text-not-working/195229 "2006-07-29T22:55:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![McGuffin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mcguffin/32/408_2.png) [@McGuffin](https://forum.kirupa.com/u/McGuffin)\
**Post date:** [July 29, 2006, 10:55pm UTC](https://forum.kirupa.com/t/setting-onsetfocus-text-not-working/195229/1 "2006-07-29T22:55:48Z")

</div>

I’m absolutely and completely dumbfounded by this problem…

```auto

target.txtField.onSetFocus = function() {
    trace(inputText.getFieldText()); // custom function, outputs a string (ex. "name")
    if (this.text == inputText.getFieldText()) {
        // this IF statement runs through fine
        this.text = ""; // won't work, no matter if I set it to empy or anything...
    }
}

```

I’m probably doing something very stupid here… but I can’t figure out what. I’ve done my research, gone over examples online and in books, still not working. The text field goes blank, but I cannot type into it, and it loses focus (if I try using Selection.setFocus(this); it doesn’t work).
