# Clear a textfield when you select it

**URL:** <https://forum.kirupa.com/t/clear-a-textfield-when-you-select-it/12204>\
**Category:** Uncategorized\
**Created:** [January 28, 2003, 12:11pm UTC](https://forum.kirupa.com/t/clear-a-textfield-when-you-select-it/12204 "2003-01-28T12:11:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thriller](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@thriller](https://forum.kirupa.com/u/thriller)\
**Post date:** [January 28, 2003, 12:11pm UTC](https://forum.kirupa.com/t/clear-a-textfield-when-you-select-it/12204/1 "2003-01-28T12:11:06Z")

</div>

Does anyone know hoe to clear a textfield when you click on it. I know how to do this in mx, but I now need to know how to do it in 5 or 4 if possible.

I hope someone can help me with this.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 28, 2003, 7:14pm UTC](https://forum.kirupa.com/t/clear-a-textfield-when-you-select-it/12204/2 "2003-01-28T19:14:38Z")

</div>

onClipEvent(mouseUp){  
if (eval(Selection.getFocus()) == textVar) textVar= “”;  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 30, 2003, 2:37pm UTC](https://forum.kirupa.com/t/clear-a-textfield-when-you-select-it/12204/3 "2003-01-30T14:37:40Z")

</div>

Thanx, but where do I put the code, I tried everything, but nothing works.

Please note that I’m a rookie with flash 5
