Come to think of it, I did create something like this before when I was playing around with a multi select dropdown problem here in the forum:
As you can see in the video, the template has a predictive text feature. I believe I layered a label underneath the text field, and made the text field background transparent. The predictive label is then populated with scripting on one of the keypress events. It wouldn't be difficult to add a special key condition to the keyReleased or keyPressed event to move the label text into the actual text field.