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 and Schema item settings.
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:
Add a TextInput component and a CheckBox component to your application, and give them instance names.
Select the TextInput component, and click the Schema tab on the Component inspector.
Click the Add a Component Property (+) button at the upper left of the Schema tab to add a component property.
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.
Click the Bindings tab, and click the Add Binding (+) button to add a binding.
In the Add Binding dialog box, select the editable property, and click OK.
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.
In the Bound To dialog box, select the CheckBox component under Component Path, and click OK.
Select the Checkbox component on the Stage, and click the Parameters tab in the Component inspector.
Select Control > Test Movie. To test the functionality, type a value into the TextInput component and then deselect the CheckBox component. You should now be unable to enter text into the TextInput component.
Version 8
Comments
No screen name
said on
Mar 6, 2007
at
3:03 PM :
step 9 ("Select the Checkbox component on the Stage, and click the Parameters tab in the Component inspector.") should probably mention that the user needs to change the "selected" property to "true"
Comments
No screen name said on Mar 6, 2007 at 3:03 PM :