How schema settings work (Flash Professional only)

Every schema item has four attributes: Data Type, Encoder, Formatter, and Kind. These settings control how data binding processes data values that it gets from, and sets to, components.

How schema settings modify the data flowing in and out of a component

When Flash wants to get data from a component, the data is fetched from the component according to the Kind setting. At this point, the data is in whatever format the component provides (the raw form of the data). For example, the XMLConnector component always provides data as a string, the NumericStepper component provides nNumbers, and so on. The encoder's job is to convert this data to an ActionScript data type; for example, the string data that you get from an XML document may really represent a date or a number (the normal form of the data). If data binding needs the data in string form (because it is being assigned to a text component, for example) the formatter is used to do this conversion. If there are several bindings from a field, the formatter is used only for those bindings that are assigning to a field whose type is String.

When you want to set data into a component, you first need to convert the data to the normal form—this conversion is automatic, depending on the Data Type setting. If the data is a string and a Formatter setting exists, then the formatter is used to convert the data from string to normal form. The Data Type setting also controls whether you inspect the data to see if it's valid, and returns valid or invalid events accordingly. The encoder is then used to convert the data from normal to raw form, and the kind then finally passes the data to the component.

This processing takes place only when the data field is accessed via data binding. It is possible to directly access a component property from your Actionscript code, but when you do this, you're working with the raw value of the data, not the data value that results from the action of data types, encoders, formatters, and kinds.