Formatting a Portion of Existing Text : Text format : TextField Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » TextField » Text format »

 

Formatting a Portion of Existing Text


 

package {

  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
      var formatter:flash.text.TextFormat = new flash.text.TextFormat(  );
      formatter.color = 0x0000FF;      // Make the text blue
      field.text="12345678900987654321asdfasdf";   
      field.setTextFormat(formatter,0,10);                               
      field.setTextFormatformatter,10,20)
      addChild(field);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo TextField
» Text format