TextField.multiline Property | Flash 5 |
Boolean; enables or disables multiline user inputFlash 6; accessible only via authoring tool in | read/write |
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.
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;
TextField.maxChars, TextField.restrict, TextField.type, TextField.wordWrap