Setting the schema path
The
property for a schema field is an optional setting that is used in special
path
circumstances when the schema for your component is not appropriate. Using this setting,
you can create a virtual schema field (a field that exists in one location but pulls its value from
another). The value of this property is a path expression that is entered in one of the following
formats:
For schemas that contain ActionScript data, the path follows the format
where
[.field]...,
addresslist.street
For schemas that contain XML data, the path follows the format
standard XPath statement (such as
When data binding is performed, Flash checks to see if there is a path expression for a schema
field. If so, it uses the path expression to locate the correct value. For more information, see
"Virtual schemas" on page
The path expression is always performed relative to the parent node of the schema field.
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 and Flash Professional 8:
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
DataSet.calcFields
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
. You would set the
totalPrice
can assign it a value at runtime, as shown in the following example:
function calculatedFunct(evt) {
evt.target.totalPrice = (evt.target.price * evt.target.quantity);
}
436
Data Integration (Flash Professional Only)
is equal to the name of a field (such as
field
).
addressList/street
444.
event when any non-calculated field in a data set's current data record
property for
kind
XPath,
).
kind.
Data
,
price
quantity
to
totalPrice
Calculated
field
where
is a
XPath
, and
so that you
Need help?
Do you have a question about the FLASH 8-USING FLASH and is the answer not in the manual?