User Guide
800 List component
The second usage example uses an on() handler and must be attached directly to a List
instance. The keyword
this, used inside an on() handler attached to a component, refers to
the component instance. For example, the following code, attached to the List instance
my_list, sends “_level0.my_list” to the Output panel:
on (scroll) {
trace(this);
}
Example
The following example sends the direction and position of the list every time the list items
are scrolled:
var my_list:mx.controls.List;
my_list.rowCount = 2;
for (var i:Number = 0; i < 10; i++) {
my_list.addItem({data:i, label:"Item #" + i});
}
var listListener:Object = new Object();
listListener.scroll = function(evt_obj:Object) {
trace("list scrolled (direction:" + evt_obj.direction + ", position:" +
evt_obj.position + ")");
};
my_list.addEventListener("scroll", listListener);
List.selectable
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
listInstance.selectable