Mega Code Archive

 
Categories / Flash ActionScript / TextField
 

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     }   } }