Dataholder Component (Flash Professional Only) - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

DataHolder component (Flash Professional only)

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
more properties 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.
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 will 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:
If a data value is generated by ActionScript, you might want to bind it to some other
components. In this case, you could have a DataHolder component that contains properties
that are bound as desired. Whenever new values are assigned to those properties (by means of
ActionScript, for example) those values will be distributed to the data-bound object.
You might have a data value that results from a complex indexed data binding, as shown in the
following diagram.
Web Service Method
getMovies
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.
286
Chapter 6: Components Dictionary
Results
Results[movieList.selectedIndex]
DataModel
myDataModel
Components Dictionary
UI ListBox
movieList
data.movieTitle
data.movieRating
data.movieTimes
CHAPTER 6
. You can add
data
UI TextField
title
UI TextField
rating
UI ListBox
times

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents