4 Replies Latest reply on Aug 10, 2011 1:51 AM by adelrisco1976

    Styling a dynamic text field

    adelrisco1976

      Hi guys

       

      I am having a problem styling a dynamic text (see code below) as the font and font size are not working on our movie.

       

      Can you spot, what we could be doing wrong?

       

      Thanks in advance
      Andres


           
      var count:Number = 10082145;
      var maxNum:Number = 20082145;
      var num:Number = 1;
      this.createTextField("txt", this.getNextHighestDepth(), 900, 20, 100, 50) ;
      txt.textColor = 0xFFFFFF;
      var emphatic:TextFormat = new TextFormat();
      emphatic.bold = true;
      emphatic.size = 16;
      emphatic.font = "Arial";
      txt.setTextFormat(emphatic);

       

      onEnterFrame = function () {
          count += num;
          if (count >= maxNum) {
              num = 0;
              txt.text = "20082145";
          } else {
              var v = count / (maxNum / 20082145);
              txt.text = v;
             
              var str = String(v);
              var io = str.indexOf('.');
              if (io == -1)
              {
                  txt.text = v + '0';
              }
          }

       


         
      };