MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 294

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

Advertisement

Schema kinds
A kind determines how a schema item for your component should be accessed at runtime. The
following kinds come with Flash MX Professional 2004:
None
The default kind. This kind is identical to the
Data
The schema item is a data structure, and the data field is stored within the data structure
as specified by the field's schema location. This is the normal case. The data structure can be in
either ActionScript or XML form.
Calculated
This kind is used with the DataSet component. You can use it to define a calculated
field (a virtual field whose value is calculated at runtime, based on the values of other fields). You
write an event handler in ActionScript code that is invoked by the
when any non-calculated field in a data set's current data record changes. The event handler must
set the value of the calculated fields in that record. There is no special processing when getting or
setting the value of a calculated field. For example, in the DataSet component you might define
three fields, called
to
totalPrice
Calculated
following example:
function calculatedFunct(evt) {
evt.target.totalPrice = (evt.target.price * evt.target.quantity);
}
ds.addEventListener('calcFields', calculatedFunct);
}
See the
DataSet.calcFields
AutoTrigger
This kind can be applied to any property of any component but is mainly useful
for connector component properties. When a new value is assigned to the property through data
binding, the trigger method of the component is called. For more information, see
WebServiceConnector.trigger()
You can create custom kinds. The number of kinds allowed is unlimited. Kinds are defined by
XML files found in the Flash MX Professional 2004 Configuration/Kinds folder. The definition
includes the following metadata:
An ActionScript class that will be instantiated to mediate access to the data
A Kind Options dialog box
Schema encoders
An encoder determines how a schema item for your component should be encoded/decoded at
runtime. Sometimes you might want a component property to have a different data type that
what is actually stored inside the component. For example, an XMLConnector component results
property is stored as an XML document, which contains only strings. You might want a certain
field in the results to appear as a Boolean value instead.
294
Chapter 14: Data Integration (Flash Professional Only)
,
, and
price
quantity
so that you can assign it a value at runtime, as shown in the
event in Using Components.
and
kind.
Data
. You would set the
totalPrice
XMLConnector.trigger()
DataSet.calcFields
property for
kind
in Using Components.
event

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents