Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > TextField > length (TextField.length property) | |||
public length : Number [read-only]
Indicates the number of characters in a text field. This property returns the same value as text.length, but is faster. A character such as tab (\t) counts as one character.
Availability: ActionScript 1.0; Flash Player 6
The following example outputs the number of characters in the date_txt text field, which displays the current date.
var today:Date = new Date();
this.createTextField("date_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
date_txt.autoSize = true;
date_txt.text = today.toString();
trace(date_txt.length);
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player 7 or later. If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002213.html