Combobox.additemat() - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

ComboBox.addItemAt()

Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
comboBoxInstance.addItemAt(index, label[, data])
comboBoxInstance.addItemAt(index, {label:label[, data:data]})
comboBoxInstance.addItemAt(index, obj);
Parameters
A number 0 or greater that indicates the position at which to insert the item (the
index
index of the new item).
A string that indicates the label for the new item.
label
The data for the item; it can be of any data type. This parameter is optional.
data
An object with
obj
Returns
The index at which the item was added.
Description
Method; adds a new item to the end of the list at the index specified by the
Indices greater than
ComboBox.length
Example
Start with a ComboBox component instance named
instance named
my_btn
frame of the main timeline. When you test the SWF file, click the combo box to see two items
in it. Then click the button, and the next time you click the combo box, you'll see that it
added another item labeled "first value":
my_cb.addItem({data:2, label:"second value"});
my_cb.addItem({data:3, label:"third value"});
var btnListener:Object = new Object();
btnListener.click = function()
my_cb.addItemAt(0, {data:1, label:"first value"});
};
my_btn.addEventListener("click", btnListener);
172
ComboBox component
and
properties.
label
data
are ignored.
. Add the following ActionScript to the Actions panel for the first
{
, and a Button component
my_cb
parameter.
index

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