View comments | RSS feed

Adding a component property to a schema

You typically add component properties to a schema for the following reasons:

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.
  8. In the Bound To dialog box, select the CheckBox component under Component Path, and click OK.
  9. Select the Checkbox component on the Stage, and click the Parameters tab in the Component inspector.
  10. 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"

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00000763.html