# FocusEvent in input textField

**URL:** <https://forum.kirupa.com/t/focusevent-in-input-textfield/234181>\
**Category:** flash\
**Created:** [July 31, 2007, 9:51am UTC](https://forum.kirupa.com/t/focusevent-in-input-textfield/234181 "2007-07-31T09:51:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sger\_error](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@sger\_error](https://forum.kirupa.com/u/sger_error)\
**Post date:** [July 31, 2007, 9:51am UTC](https://forum.kirupa.com/t/focusevent-in-input-textfield/234181/1 "2007-07-31T09:51:45Z")

</div>

textField.addEventListener(FocusEvent.FOCUS\_IN, onFocusIn);  
textField.addEventListener(FocusEvent.FOCUS\_OUT, onFocusOut);

private function onFocusIn(event:FocusEvent):void{  
if(textField.text == event.target.text){  
textField.text = " ";  
}

}

private function onFocusOut(event:FocusEvent):void{

}

on focus out event i want to restore the original value of the input textfield or the last value.

any ideas

Thanks
