Name

newline Constant — insert a line break

Availability

Flash 4 and later

Synopsis

newline

Returns

A newline character.

Description

The constant newline represents a standard line break character (ASCII 10). It is synonymous with the escape sequence "\n" and is used to force a line break in a block of text (usually for display in a text field variable).

Usage

Though newline was a function in Flash 4, it became a constant in Flash 5 and has a syntax that resembles a property or variable. Note that parentheses are not used following newline.

Example

myOutput = "hello" + newline + "world";

See Also

See Section 4.5.2.2 in Chapter 4

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.