User Guide

262 Chapter 14: Data Integration (Flash Professional Only)
There are several ways to define the schema for a component. Here are the most common ways:
For an XMLConnector component, you can import an XML sample file to define the schema.
See “Connecting to XML data with the XMLConnector component (Flash Professional only)”
on page 277.
For a WebServiceConnector component, you can import the WSDL for a web service to
define the schema. See “Connecting to web services with the WebService connector
component (Flash Professional only)” on page 274.
For a DataSet component, which is typically the intermediary component between your
connector components and UI components, you define the schema using the Schema panel.
See Adding a component property to a schema” on page 262 and Adding a schema field to a
schema item” on page 263.
For UI components, the schema is predefined within the component. You can modify the
schema to create additional bindable properties, as shown in Adding a component property to
a schema” on page 262.
Adding a component property to a schema
You typically add component properties to a schema for the following reasons:
To make an existing component property bindable. You can make any component property
bindable if you add it to the schema.
To define the fields of a DataSet component to describe expected data fields. Most commonly,
you need to define the data type for an expected field, but there are numerous other properties
you can set. For more information, see the examples in Accessing the data” on page 284 and
“Schema item settings” on page 289.
The following example illustrates how you make an existing component property bindable by
adding the component property to the component’s schema. In the example, you create an
application that uses a CheckBox component to indicate whether a TextInput component is
editable. Because the TextInput component’s schema does not initially contain the
editable
property, you add the
editable property to the schema to bind it to the CheckBox component.
To add a component property to a schema to make the property bindable:
1.
Add a TextInput component and a CheckBox component to your application, and give them
instance names.
2.
Select the TextInput component, and click the Schema tab on the Component inspector.
3.
Click the Add a Component Property (+) button at the upper left of the Schema tab to add a
component property.
4.
In the Schema Attributes pane (the bottom pane of the Schema tab), enter editable for the field
name value and select Boolean for the data type value.
5.
Click the Bindings tab, and click the Add Binding (+) button to add a binding.
6.
In the Add Binding dialog box, select the editable property, and click OK.
7.
In the Binding Attributes pane at the bottom of the Bindings tab, click the Bound To item
under Name, and click the magnifying glass icon across from the Bound To item under Value.