To set the alignment for a range of paragraphs, we apply the format using beginIndex and endIndex arguments that include the desired paragraphs : Text format : TextField Flash / Flex / ActionScript examples
To set the alignment for a range of paragraphs, we apply the format using beginIndex and endIndex arguments that include the desired paragraphs
package{ import flash.display.Sprite; import flash.text.*; public class Main extends Sprite{ public function Main(){ var t:TextField = new TextField( ); t.width = 300; t.border = true;
t.text = "This is paragraph one.nThis is paragraph two.";
var alignFormat:TextFormat = new TextFormat( ); alignFormat.align = TextFormatAlign.CENTER;