TextInput.hPosition

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

textInputInstance.hPosition

Description

Property; specifies how many pixels have been scrolled to accommodate the user's entry in the TextInput box. The default value is 0.

NOTE

The value changes for the same text on different computers because of monitor, screen size, and font characteristics.

Example

The following example creates a listener for a change event on the TextInput instance called my_ti. The listener accesses the hPosition property to display the current position for each character the user enters.

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.

/**
 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);
};
// Add listener.
my_ti.addEventListener("change", tiListener);