Flash ActionScript 3 Tutorial: Line Break in Text Field
Sometimes you may require to insert line break and paragraph break in Text Field of Flash Movie for better presentation. This Flash ActionScript tutorial shows how to do it.
Flash Tutorial Content:
Sometimes you may wonder how to add line break or paragraph to the Text Field. The most easiest way is to use HTML tag, i.e. <BR> and <P>.
The complete Flash Movie is shown as above, you may try how it works before you start this Flash ActionScript tutorial.
Flash ActionScript Codes:
//Set the multiline parameter of the Text Field to true
//The <br> tag creates a line break in the Text Field.
//Must set the text field to be a multiline Text Field to use this tag.
output_txt.multiline = true;
//Allow HTML Property of the TextField
output_txt.htmlText = "This is the 1st line." + "<br>" +
"This is the 2nd line." + "<br>" +
"This is the 3rd line.";
Download Flash Source File:
using-line-break-in-textfield.fla
Remarks:
This Flash ActionScript tutorial shows how to insert line break and paragraph break in Text Field.