TextInput.length
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
textInputInstance.length
Description
Read-only property; a number that indicates the number of characters in a TextInput
component. A character such as tab (
Example
The following example creates a listener for the change event on the TextInput instance
. The listener accesses the
my_ti
the user enters text.
You must first drag a TextInput component to the Stage and give it an instance name of
; then add the following code to Frame 1.
my_ti
/**
Requires:
- TextInput instance on Stage (instance name: my_ti)
*/
var my_ti:mx.controls.TextInput;
// Create listener object.
var tiListener:Object = new Object();
tiListener.change = function(evt_obj:Object) {
trace("Length of text: " + my_ti.length);
};
// Add listener.
my_ti.addEventListener("change", tiListener);
) counts as one character. The default value is 0.
"\t"
property to display the length of the text in
length
as
my_ti
TextInput.length
1225
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?