User Guide
DataHolder class 315
3. Drag a DataGrid component to the Stage and name it namesGrid.
4. Select the DataHolder component and open the Component inspector.
5. Click the Schema tab in the Component inspector.
6. Click the Add Component Property (+) button located in the top pane of the Schema tab.
7. In the bottom pane of the Schema tab, type namesArray in the Field Name field, and select
Array from the Data Type pop-up menu.
8. Click the Bindings tab in the Component inspector, and add a binding between the
namesArray property of the DataHolder component and the dataProvider property of
the DataGrid component.
For more information on creating bindings with the Bindings tab, see “Working with
bindings in the Bindings tab (Flash Professional only)” in Using Flash.
9. In the Timeline, select the first frame on Layer 1 and open the Actions panel.
10. Enter the following code in the Actions panel:
dataHolder.namesArray = [{name:"Tim"},{name:"Paul"},{name:"Jason"}];
This code populates the namesArray array with several objects. When this variable
assignment executes, the binding that you established previously between the DataHolder
component and the DataGrid component executes.
11. Test the file by selecting Control > Test Movie.
DataHolder class
Inheritance MovieClip > DataHolder
ActionScript class name mx.data.components.DataHolder
The DataHolder component is a repository for data and a means of generating events when
that data has changed. Its main purpose is to hold data and act as a connector between other
components that use data binding.
Initially, the DataHolder component has a single bindable property named
data. You can add
more properties by using the Schema tab in the Component inspector.
Property summary for the DataHolder class
The following table lists the properties of the DataHolder class.
Property Description
DataHolder.data Default bindable property for the DataHolder component.