[flash cs3]Help with keyboard onscreen, and making it put letters in a text field

Hi there. can you help me with making a actionscript that can transfer chosen letter-button into a dynamic or input text field?

for instance clicking on the onscreen keyboard 's letter T, will get a T appear in the text field and so on.

there were a person on another forum saying this: (but im not that good in actionscript so i didnt quite understand what to do.

"
[COLOR=DimGray]declare array to store buttons;

initialization function
{
clear textbox;

store buttons in array;

loop
{
    set button modes;
    add click events to buttons;
}

}

click handler function
{
switch (current event)
{
case button:
add letter/text to textbox;
break;
default:
break;
}
}

call initialization function;[/COLOR]

"

Thanks for your time… :open_mouth: