Yes I know this effect is way over-done, but there is still a need for it. So I wrote an AS3 class that handles it simply.
This movie requires Flash Player 9
source ZIP file
The AS file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | package { import flash.events.TimerEvent; import flash.utils.Timer; public class typewriter { public var txtTimer:Timer; private var textArray:Array = new Array(); private var t1:String; private var counter:Number = 0; private var textPath:Object private var ready:Boolean = true; public function typewriter() { } public function writeIt(_inputTxt:String, _textPath:Object, _appendInt:Number) { if(ready == true) { textPath = _textPath; var inputTxt:String = _inputTxt; var appendInt:Number = _appendInt; textArray = []; textArray.length = 0; t1 = inputTxt; textArray = t1.split(""); counter = 0; textPath.text = ""; txtTimer = new Timer(appendInt, textArray.length); txtTimer.addEventListener(TimerEvent.TIMER, appendText); txtTimer.addEventListener(TimerEvent.TIMER_COMPLETE, txtTimerStop); txtTimer.start(); ready = false; } } private function appendText(event:TimerEvent):void { textPath.appendText(textArray[counter]); counter++; } public function txtTimerStop(e:TimerEvent) { ready = true; } } } |
To call the typewriter.as function:
1 2 3 | var newTypewriter:typewriter = new typewriter; var firstMessage:String = "type your text in the input box then hit go to see demonstration."; newTypewriter.writeIt(firstMessage, outputTextBox, 30); |

Thanks. i tray to do my first flash website and You save me loot of time with this class.and this is only one i can find!!!
will be nice just load .xml or .txt file in some next relase
but anyway big big Thanks
regards
robert
Ive been scouting far and wide for this effect but one which can handle html text. It gets a lot trickier when the string contains html chars… Let me know if you ever come across one or ever give it a go.
btw. your work is great keep at it.