TextField.selectable Property

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

Boolean; enables or disables selection by the user read/write
theField.selectable

Description

The Boolean selectable property governs whether the characters in theField can be selected by the user. By default, all text fields can be selected (selectable is true). To create a nonselectable text field for display only, set its selectable property to false:

this.createTextField("output_txt", 1, 0, 0, 200, 20); output_txt.selectable = false; output_txt.text = "This is output only.";

To create a text field that can receive user input, set its type property to "input" and ensure that selectable is true:

this.createTextField("input_txt", 1, 0, 0, 200, 20); input_txt.selectable = true; input_txt.border = true; input_txt.type = "input"; input_txt.text = "This field can accept input.";

When selectable is false, a field cannot receive user input, nor can it be focused by the user. However, a text field can always be focused and selected programmatically with the Selection object, regardless of the value of its selectable property.

See Also

The Selection object, TextField.maxChars, TextField.onKillFocus( ), TextField.onSetFocus( ), TextField.restrict, TextField.type



    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