MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 206

Components language reference
Table of Contents

Advertisement

Example
The following examples are based on a ComboBox instance named
, which
myComboBox
contains four elements labeled
,
,
, and
:
"Apples"
"Bananas"
"cherries"
"Grapes"
// First, populate the ComboBox with the elements.
myComboBox.addItem("Bananas");
myComboBox.addItem("Apples");
myComboBox.addItem("cherries");
myComboBox.addItem("Grapes");
// The following statement sorts using the order parameter set to "ASC",
// and results in a sort that places "cherries" at the bottom of the list
// because the sort is case-sensitive.
myComboBox.sortItemsBy("label", "ASC");
// resulting order: Apples, Bananas, Grapes, cherries
// The following statement sorts using the order parameter set to "DESC",
// and results in a sort that places "cherries" at the top of the list
// because the sort is case-sensitive.
myComboBox.sortItemsBy("label", "DESC");
// resulting order: cherries, Grapes, Bananas, Apples
// The following statement sorts using the optionsFlag parameter set to
// Array.CASEINSENSITIVE. Note that an ascending sort is the default
setting.
myComboBox.sortItemsBy("label", Array.CASEINSENSITIVE);
// resulting order: Apples, Bananas, cherries, Grapes
// The following statement sorts using the optionsFlag parameter set to
// Array.CASEINSENSITIVE | Array.DESCENDING.
myComboBox.sortItemsBy("label", Array.CASEINSENSITIVE | Array.DESCENDING);
// resulting order: Grapes, cherries, Bananas, Apples
204
ComboBox 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