EasyManua.ls Logo

MACROMEDIA FLASH 8-USING FLASH - Page 399

MACROMEDIA FLASH 8-USING FLASH
678 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Data binding (Flash Professional only) 399
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.

Table of Contents

Related product manuals