# Dynamic text in typewriter effect

**URL:** <https://forum.kirupa.com/t/dynamic-text-in-typewriter-effect/233903>\
**Category:** flash\
**Created:** [July 27, 2007, 9:00pm UTC](https://forum.kirupa.com/t/dynamic-text-in-typewriter-effect/233903 "2007-07-27T21:00:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)\
**Post date:** [July 27, 2007, 9:00pm UTC](https://forum.kirupa.com/t/dynamic-text-in-typewriter-effect/233903/1 "2007-07-27T21:00:32Z")

</div>

Is it possible to increase the space between characters typed in the AS below? Doing it in the text panel of the letter mc breaks the effect.

```auto

function typewriter(target:MovieClip, delay:Number):Void {
 target.interval = function() {
  target._visible = true;
  keyHit.start(0, 1);
  clearInterval(target.intervalID);
 };
 target.intervalID = setInterval(target, "interval", delay);
 target._visible = false;
}
function placeText(target:MovieClip, x:Number, y:Number, banner:String, tFormat:TextFormat):Void {
 // For each character...
 for (var i = 0; i<banner.length; i++) {
  // Create a clip and place the current
  // character of the text field inside it.
  var char:MovieClip = target.attachMovie("letter", "char"+i, target.getNextHighestDepth());
  char.field.text = banner.substr(i, 1);
  char._x = x;
  char._y = y;
  // Add the width of the current text character to the
  // next letter's x position.
  x += tFormat.getTextExtent(char.field.text).width;
  //
  // Here is the effect call.
  var timer = i*200+Math.round(Math.random()*200);
  typewriter(char, timer);
 }
}
var keyHit = new Sound(this);
keyHit.attachSound("typeClick");
var format:TextFormat = new TextFormat();
format.font = "Arial";
format.size = 24;
placeText(this, 145, 40, "typewriter text here", format);

```
