User Guide

764 List component
List parameters
You can set the following authoring parameters for each List component instance in the
Property inspector or in the Component inspector:
data is an array of values that populate the data of the list. The default value is [] (an empty
array). There is no equivalent runtime property.
labels is an array of text values that populate the label values of the list. The default value is []
(an empty array). There is no equivalent runtime property.
multipleSelection is a Boolean value that indicates whether you can select multiple values
(
true) or not (false). The default value is false.
rowHeight indicates the height, in pixels, of each row. The default value is 20. Setting a font
does not change the height of a row.
You can write ActionScript to set additional options for List instances using its methods,
properties, and events. For more information, see “List class on page 770.
Creating an application with the List component
The following procedure explains how to add a List component to an application while
authoring. In this example, the list is a sample with three items.
To add a simple List component to an application:
1. Drag a List component from the Components panel to the Stage.
2. Select the Free Transform tool and resize the component to fit your application.
3. In the Property inspector, do the following:
Enter the instance name my_list.
Enter Item1, Item2, and Item3 for the labels parameter.
Enter item1.html, item2.html, item3.html for the data parameter.
4. Select Control > Test Movie to see the list with its items.
5. Return to the authoring environment, insert a new layer, and name it actions.
6. Add the following ActionScript to Frame 1 of the actions layer.
my_list.change = function(evt:Object) {
getURL(evt.target.selectedItem.data, "_blank");
};
my_list.addEventListener("change", my_list);