ActionScript 2.0 Components Language Reference |
|
|
|
| TextInput component > TextInput.maxHPosition | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
textInputInstance.maxHPosition
Read-only property; the value of maxHPosition is the pixel position of the character that is visible when the pointer has been moved to the very right of the text. It's not the last character's pixel position. Rather, it's the pixel position all the way to the right of the last character in the TextInput field. The default value is 0.
You must first drag a TextInput component to the Stage and give it an instance name of my_ti; then add the following code to Frame 1.
The following code creates a listener for a change event on the TextInput instance called my_ti. When the change event occurs, the listener displays the current hPosition and maxHPosition values for each character that the user enters:
/**
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("hPosition: " + my_ti.hPosition + " of " + my_ti.maxHPosition);
};
// Add listener.
my_ti.addEventListener("change", tiListener);
|
|
|
|