• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Data Binding

Data binding is a feature introduced back in Flash MX 2004 Professional. It allows you to tie properties of components to one another that will automatically update when certain component events fire. It makes creating web-service-driven applications that much easier because there is very little code required. In fact, you will see that the preceding example can be done in a single line of code.

1.
Return to the stage and open up the Actions panel in the first frame of the actions layer. Remove all but the last line, so the code should now read like this:

myConnector.trigger();

2.
Now select the WebServiceConnector component, go to the Component Inspector panel (Window, Component Inspector), and select the Binding tab.

3.
Select the Add Binding button, and the panel should then look like Figure 25.7. Choose results:String and click OK.

Figure 25.7. The Add Binding dialog box used to add data bindings between components for fast development.


4.
Now you will see the “results” data binding in the Component Inspector panel. Select it and click in the bound to field.

5.
When you do this, a magnifying glass will appear at the end of the field. Select it, and the Bound To dialog box appears as shown in Figure 25.8. (You can also double-click this field to get the same result.)

Figure 25.8. The Bound To dialog box.


6.
Select the TextInput component in the left window and click OK.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint