Textfield getfocus issue

Hi there

This is what I want to do:

I have an onscreen keyboard created in flash that when you touch the buttons inputs text into text fields - i.e. name, email address etc (this will be used on a kiosk touchscreen).

My issue is that I have three textfields on the stage and I need the keyboard buttons to recognise which textfield the user is in so it will input the text into the correct textfieds.

Basically what I’m wanting to say is “if the focus is on this field, type letters into it”, but my scripting is not very advanced. Am I right in thinking I’ll need a getFocus and an if Statement?

Any help would be much appreciated!