mcN = "letter";

alphaInc    = (100 - alpha) / increments;
radianInc    = 3.1416 / increments;

aLetters = new Array();

for (i = 0; i< numChar; i++)
{
  aLetters[i+0] = i;
  var letter =  this[mcN +i];
  letter._visible = false;
  letter.init = letterInit;
  letter.doEffect = effect;
  letter.number = i;
}

function letterInit()
{
  this.step       = 0;
  this.radian     = 0;
  this._visible   = true;
  this._xscale    = 100;
  this._yscale    = 100;
  this._alpha     = this._parent.alpha;
  this.alphaInc   = this._parent.alphaInc;
  this.finalX     = this._x;
  this.finalY     = this._y;
  this.increments = this._parent.increments;
  this.yDis       = this._parent.yDis;
  this.xscale     = this._parent.xscale;
  this.yscale     = this._parent.yscale;
  this.radianInc  = this._parent.radianInc;
}

function effect()
{
  this.radian  += this.radianInc;
  factor        = Math.sin(this.radian);

  this._xscale   = (this.xscale - 100) * factor + 100;
  this._yscale   = (this.yscale - 100) * factor + 100;
  this._y        = this.yDis * factor + this.finalY;

  this._alpha  += this.alphaInc;

  this.step = this.step + 1;

  if (this.step >= this.increments)
  {
    this._xscale = 100;
    this._yscale = 100;
    this._alpha  = 100;
    this._x      = this.finalX;
    this._y      = this.finalY;
    this.gotoAndStop("end");
  }
}

function shuffle()
{
  return Math.floor(Math.random() * 3) -1;
}

if (random == 1)
{
  aLetters.sort(shuffle);
}

if (reverse == 1)
{
  aLetters.reverse();
}