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

Components language reference
Table of Contents

Advertisement

List.addItem()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
listInstance.addItem(label[, data])
listInstance.addItem(itemObject)
Parameters
A string that indicates the label for the new item.
label
The data for the item. This parameter is optional and can be of any data type.
data
An item object that usually has
and
properties.
itemObject
label
data
Returns
The index at which the item was added.
Description
Method; adds a new item to the end of the list.
In the first usage example, an item object is always created with the specified
property,
label
and, if specified, the
property.
data
The second usage example adds the specified item object.
Calling this method modifies the data provider of the List component. If the data provider is
shared with other components, those components are updated as well.
Example
Both of the following lines of code add an item to the
instance. To try this code, drag
my_list
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.addItem("this is an Item");
my_list.addItem({label:"Gordon", age:"very old", data:123});
776
List component

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents