function typewriter(target, delay)
{
target.interval = function ()
{
target._visible = true;
keyHit.start(0, 1);
clearInterval(target.intervalID);
};
target.intervalID = setInterval(target, "interval", delay);
target._visible = false;
} // End of the function
function placeText(target, x, y, banner, tFormat)
{
var _loc2 = 0;
while (_loc2 < banner.length)
{
var _loc1 = target.attachMovie("letter", "char" + _loc2, target.getNextHighestDepth());
_loc1.field.text = banner.substr(_loc2, 1);
_loc1._x = x;
_loc1._y = y;
x = x + tFormat.getTextExtent(_loc1.field.text).width;
var _loc3 = _loc2 * 200 + Math.round(Math.random() * 200);
typewriter(_loc1, _loc3);
++_loc2;
} // end while
} // End of the function
var keyHit = new Sound(this);
keyHit.attachSound("typeClick");
var format = new TextFormat();
format.font = "Verdana";
format.size = 14;
placeText(this, 70, 100, "Это - текстовый эффект печатающей машинки.", format);