1 Reply Latest reply on Oct 24, 2008 12:38 PM by Gregory Lafrance

    Simple Stuff Not Working with Text Formats

    mattk999



      private function onApplicationComplete():void
      {
      height = 700;
      width = 1000;

      canvas = new Canvas();
      canvas.width = 200;
      canvas.height = 200;

      tx = new UITextField();
      tx.width = 100;
      tx.height = 100;

      var format:TextFormat = new TextFormat();

      format.color = 0xff0000; // red
      format.font = "Arial";
      format.size = 20;

      addChild(canvas);
      canvas.addChild(tx);

      // ?????????
      // should display "text" in red 20-point arial but actually in default 10-point black format
      // ?????????

      tx.text = "text";
      tx.setTextFormat(format);
      }