Playing specific sound files based on letters in user entered word

Hi

I had an idea.

I was thinking that it may be possible to create a primitive, yet usable actionscript based text to speech system for Flash movies (One that is platform independent).

The biggest problem that I could think of off hand is this.

Is it possible to right a series of actionscript commands that would play a collection of certain sound files based on what word or words the user has entered?

For example:

If the user types “Red Pen”

Can actionscript tear apart those two words and play sound files “Arr”, “ee”, “Dee”, “Pee”, “ee” and “EN”?

If it is possible, and if someone could help me out on it, then I’ll start figuring out what phonetic sounds I’ll need to record and program, and see if I can’t build a simple text to speech program for flash movies.
I have no immediate commercial application for it, and I don’t plan on one.
So if I can pull it off it’ll be free to everyone, source code and all. Of course, it may be in my voice, but it shouldn’t be hard to take what I plan to do and use it as a template for anyone else’s voice recordings.

I hope its possible, seems likely enough. I think I saw somewhere where actionscript could separate the letters of a word from each other, and from there you just need something along the lines of a series of if statements. But I don’t know where to find the code needed.

I’d appreciate any help you may be capable of offering.

-Lem