User Guide
288 Chapter 6: Components Dictionary
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.
DataHolder.data
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
dataHolder.data
Description
Property; the default item in a DataHolder object’s schema. This property is not a “permanent”
member of the DataHolder component. Rather, it is the default bindable property for each
instance of the component. You can add your own bindable properties, or delete the default
data
property, by using the Schema tab in the Component inspector.
For more information on using the Schema tab, see “Working with schemas in the Schema tab
(Flash Professional only)” in Using Flash.
Example
For a step-by-step example of using this component, see “Creating an application with the
DataHolder component (Flash Professional only)” on page 287.
The following code shows a simple example of how to populate the DataHolder component with
data that is a variable. To test the application, you enter a value into the text input field and click
the
addDate_btn instance, which adds the value to the DataHolder component. Click the
dumpDataHolder_btn instance to trace the contents of the DataHolder component.
Property Description
DataHolder.data Default bindable property for the DataHolder component.