Recipe 19.8. Formatting Data with Data BindingProblemYou want to format data that is displayed via data binding. SolutionUse a formatter. DiscussionAlthough standard data binding may work in many cases, there are at least as many cases in which you'll want to display the data in a slightly different manner than what is returned. For example, you may use an XMLConnector component to load the following XML document: <book> <title>ActionScript Cookbook</title> <authors>Joey Lott</authors> </book> If you want to display both the title and the authors in a text area component, you'll have to apply formatting that tells Flash how to display the data. When you assign values to the settings of a binding in the Bindings tab of the Component Inspector panel, there are two parameters for formatting called formatter and formatter options. The formatter parameter is set to none by default, and when the formatter parameter is set to none the formatter options is grayed out. However, you can apply formatting by selecting a new value for the formatter parameter. The options are as follows:
Each formatter type allows you to define different formatter options:
|
![]() |
![]() |
![]() |
![]() |
Tripod >> 3pod Tips & Learning and manuals for educations