ActionScript 2.0 Components Language Reference |
|
|
|
| DataHolder component | |||
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.
|
NOTE |
The DataHolder component is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings. |
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.
You can assign any type of data to a DataHolder property, either by creating a binding between the data and another property, or by using your own ActionScript code. Whenever the value of that data changes, the DataHolder component emits an event whose name is the same as the property, and any bindings associated with that property are executed.
In most cases, you do not use this component to build an application. It is needed only when you cannot bind external data directly to another component and you do not want to use a DataSet component. The DataHolder component is useful when you can't directly bind components (such as connectors, user interface components, or DataSet components) together. Below are some scenarios in which you might use a DataHolder component:

In this case it is convenient to bind the data value to a DataHolder component (called DataModel in this illustration) and then use that for bindings to the user interface.
|
NOTE |
The DataHolder component is not meant to implement the same control over your data as the DataSet component. It does not manage or track data, nor does it have the ability to update data. It is a repository for holding data and generating events when that data has changed. |
|
|
|
|