Set TextField size : size « TextField « Flash / Flex / ActionScript






Set TextField size

 
package{
  import flash.display.Sprite;
  import flash.text.*;  
  public class Main extends Sprite{
    public function Main(){
        var tfStyle:TextFormat = new TextFormat();
        tfStyle.font = "Verdana";
        tfStyle.bold = true;
        tfStyle.size = 12;
        var tContent:TextField = new TextField();
        tContent.setTextFormat(tfStyle);
        addChild(tContent);

    }
  }
}

        








Related examples in the same category

1.The width and height of a text field's rectangular display region can be set explicitly using the TextField class's instance variables width and height.