List.removeitemat() - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Example
The following code clears all items in a List component when a button is clicked. To try this
code, drag a List component to the Stage and give it the instance name my_list. Next, drag a
Button component to the Stage and give it the instance name remove_button. Add the
following code to Frame 1 in the timeline:
var my_list:mx.controls.List;
var remove_button:mx.controls.Button;
remove_button.label = "Remove";
my_list.addItem({data:"flash", label:"Flash"});
my_list.addItem({data:"dreamweaver", label:"Dreamweaver"});
my_list.addItem({data:"coldfusion", label:"ColdFusion"});
var buttonListener:Object = new Object();
buttonListener.click = function(evt_obj:Object) {
my_list.removeAll();
evt_obj.target.enabled = false;
}
remove_button.addEventListener("click", buttonListener);

List.removeItemAt()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
listInstance.removeItemAt(index)
Parameters
A number that indicates the position of the item. The value must be greater than 0
index
and less than
List.length
Returns
An object; the removed item (
794
List component
.
if no item exists).
undefined

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents