Displaying text with a border and background : border « TextField « Flash / Flex / ActionScript






Displaying text with a border and background

 
package {
  import flash.display.*;
  import flash.text.*;  // Import TextField and other classes
                        // in the flash.text package

  public class Main extends Sprite {
    public function Main (  ) {
      var t:TextField = new TextField(  );  // Create TextField object
      t.text = "Hello world";             // Set text to display
      t.background = true;           // Turn on background
      t.backgroundColor = 0xCCCCCC;  // Set background color to light gray
      t.border = true;               // Turn on border
      t.borderColor = 0x333333;      // Set order color to dark gray

      addChild(t);                   // Add text field to the display list
    }
  }
}

        








Related examples in the same category

1.Creating an Outline Around a Text Field
2.Resizable bottom border only