TextField.multiline Property

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
TextField.multiline Property Flash 5

Boolean; enables or disables multiline user inputFlash 6; accessible only via authoring tool in read/write
theField.multiline

Description

The Boolean multiline property dictates whether users can enter line breaks in theField using, say, the Return or Enter key. It applies to user input only and has no effect on text assigned with ActionScript. The default setting, false, prevents users from entering more than one line of text in the field, effectively disabling the Enter key during text entry (much like HTML's <INPUT TYPE="TEXT"> tag). A setting of true allows users to enter more than one line of text in the text field (much like HTML's <TEXTAREA> tag).

To turn word-wrapping on for lines that exceed the field's viewable region, use TextField.wordWrap. To limit the amount of text a user can enter into a text field, use TextField.maxChars.

Example

The following code creates two text fields. The first field, nameInput_txt, allows a single line of input only; the second field, addressInput_txt, allows multiple lines of input:

// Create the nameInput_txt field this.createTextField("nameInput_txt", 1, 0, 0, 200, 20); nameInput_txt.type = "input"; nameInput_txt.border = true; nameInput_txt.multiline = false; // Create the addressInput_txt field this.createTextField("addressInput_txt", 2, 0, 40, 200, 60); addressInput_txt.type = "input"; addressInput_txt.border = true; addressInput_txt.multiline = true;

See Also

TextField.maxChars, TextField.restrict, TextField.type, TextField.wordWrap



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net