title: AS3 - Numbers won't display in dynamic text field
body: <p>I am writing a program that my brother needs for a project he is working on. It "solves" a password and then shows the number of loops the program goes through before figuring out the solution. I've gotten everything working but the program won't show the numbers in the dynamic text field. It only shows the letters.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import flash.events.MouseEvent;
  
  button1.addEventListener(MouseEvent.CLICK, solvePassword);
  
  function solvePassword(e:MouseEvent):void
  {
  var pass:Number = Number(inputText.text);
  var attempts:Number = 0;
  var i:String = pass.toString();
  var passLength:Number = i.length;
  var n:Number = 0;
  
  while(n != pass)
  {
      if(passLength == 1)
      {
          n += 1;
          attempts += 1;
      }
      if(passLength == 2)
      {
          n += 1;
          if(n &lt; 10) { n = 10 }
          attempts += 1;
      }
      if(passLength == 3)
      {
          n+=1;
          if(n &lt; 100) { n = 100 }
          attempts += 1;
      }
      if(passLength == 4)
      {
          n+=1;
          if(n&lt; 1000) { n = 1000 }
          attempts += 1;
      }
      if(passLength == 5)
      {
          n+=1;
          if(n &lt; 10000) { n = 10000 }
          attempts += 1;
      }
      if(passLength == 6)
      {
          n+=1;
          if(n &lt; 100000) { n = 100000 }
          attempts += 1;
      }
      if(passLength == 7)
      {
          n+=1;
          if(n &lt; 1000000) { n = 1000000 }
          attempts += 1;
      }
  }
  
  i =  "Attempts: " + String(attempts);
  
  trace(i);
  
  aBox.text = i;
  </code></pre>
  
  <p>Any info would help, thank you!</p>