ActionScript 2.0 Components Language Reference |
|
|
|
| List component > List.hPosition | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
listInstance.hPosition
Property; scrolls the list horizontally to the number of pixels specified. You can't set hPosition unless the value of hScrollPolicy is "on" and the list has a maxHPosition that is greater than 0.
The following code displays the current value of hPosition whenever the list instance is scrolled horizontally. To try this code, drag a List component to the Stage and give it the instance name my_list. Add the following code to Frame 1 in the timeline:
var my_list:mx.controls.List;
my_list.setSize(150, 100);
my_list.hScrollPolicy = "on";
my_list.maxHPosition = 50;
my_list.addItem({data:'flash', label:'Flash'});
my_list.addItem({data:'dreamweaver', label:'Dreanweaver'});
my_list.addItem({data:'coldfusion', label:'ColdFusion'});
var listListener:Object = new Object();
listListener.scroll = function (evt_obj:Object) {
trace("my_list.hPosition = " + my_list.hPosition);
}
my_list.addEventListener("scroll", listListener);
|
|
|
|