User Guide

452 Chapter 6: Components Dictionary
Lists arent tables.
For example, DataGrid components, which extend the List class, are intended to provide an
interface for many records. They’re not designed to display complete information; theyre
designed to display enough information so that users can drill down to see more. The message
view in Microsoft Outlook is a prime example. You don't read the entire e-mail in the grid; the
mail would be difficult to read and the client would perform terribly. Outlook displays enough
information so that a user can drill into the post to see the details.
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 456.
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 list and select Modify > Transform to resize it to fit your application.
3.
In the Property inspector, do the following:
Enter the instance name myList.
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.
You could use the data property values in your application to open HTML files.
To populate a List instance with a data provider:
1.
Drag a List component from the Components panel to the Stage.
2.
Select the list and select Modify > Transform to resize it to fit your application.
3.
In the Actions panel, enter the instance name myList.