TextArea.maxHPosition

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

textAreaInstance.maxHPosition

Description

Read-only property; the maximum value of TextArea.hPosition. The default value is 0.

Example

The following example accesses the maxHPosition property to set the initial position in the TextArea called my_ta to the farthest right position.

You must first add an instance of the TextArea component to the Stage and name it my_ta; then add the following code to Frame 1.

/**
 Requires:
  - TextArea instance on Stage (instance name: my_ta)
*/

var my_ta:mx.controls.TextArea;

my_ta.setSize(320, 240);
my_ta.wordWrap = false;

var taListener:Object = new Object();
taListener.scroll = function(evt_obj:Object) {
 trace("hPosition = " + my_ta.hPosition);
}
my_ta.addEventListener("scroll", taListener);

// Load text to display and define onData handler.
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
    if (src != undefined) {
        my_ta.text = src;
  my_ta.hPosition = my_ta.maxHPosition;
    } else {
        my_ta.text = "Error loading text.";
    }
};
my_lv.load("http://www.helpexamples.com/flash/lorem.txt");

See also

TextArea.vPosition