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.
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);