TextField Listener

I am trying to add some script so that when the user clicks inside an input text field it tells another object to play a certain frame. I take it it I need to add a listener to the text field but am not sure how to go about doing this. Thanks for any help.