MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 477

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Description
Property; the selected index of a single-selection list. The value is
selected; the value is equal to the last item selected if there are multiple selections. If you assign a
value to
selectedIndex
Using the
selectedIndex
dispatch the
change
myList.dispatchEvent({type:"change", target:myList});
Example
This example selects the item after the currently selected item. If nothing is selected, item 0 is
selected.
var selIndex = myList.selectedIndex;
myList.selectedIndex = (selIndex==undefined ? 0 : selIndex+1);
See also
List.selectedIndices
List.selectedIndices
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
listInstance.selectedIndices
Description
Property; an array of indices of the selected items. Assigning this property replaces the current
selection. Setting
selection. The value is
The
selectedIndices
the second item, then the third item, and then the first item,
Example
The following example retrieves the selected indices:
var selIndices = myList.selectedIndices;
The following example selects four items:
var myArray = new Array (1,4,5,7);
myList.selectedIndices = myArray;
See also
List.selectedIndex
478
Chapter 6: Components Dictionary
, any current selection is cleared and the indicated item is selected.
property to change selection doesn't dispatch a
event, use the following code:
,
List.selectedItem
to a zero-length array (or
selectedIndices
if nothing is selected.
undefined
property reflects the order in which the items were selected. If you click
,
List.selectedItem
undefined
,
List.selectedItems
undefined
selectedIndices
,
List.selectedItems
if nothing is
event. To
change
) clears the current
returns
[1,2,0]
.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents