EasyManua.ls Logo

MACROMEDIA FLASH 8-USING FLASH - Page 435

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...
Advanced topics in data integration 435
If you use this XML file to import a schema for the XMLConnector component’s results
property, it generates the following code:
results : XML
datapacket : Object
row : Array
[n] : object
@billable: String
@hours : Integer
@id : Integer
@rate : Integer
Suppose you want to treat the row node as a record within a grid, and you want the
@billable attribute to be treated as a Boolean value and show a true or false value in the
grid instead of
ON or OFF. Getting the data into the grid is simple: You can simply bind the row
schema field to the
dataProvider property of the grid. The following procedure describes
how to get the
@billable attribute to be treated as a Boolean value and display a true or
false value.
To make the @billable attribute display a true or false value:
1. Select the XMLConnector component, click the Schema tab, and select the @billable
schema field.
2. In the bottom pane of the Schema tab, set the data type property to Boolean.
3. Set the encoder property to Boolean.
4. Select Encoder Options and enter on for strings that represent true, and enter off for
strings that represent
false.
The encoder now takes the XML data in its raw form (String) and converts it into an
ActionScript Boolean value. Using the encoder options, it knows how to encode the string
values correctly.
5. Click Formatter, and select Boolean. Select Formatter Options. You now have a choice to
define how a
true and false value should appear as a string.
6. Enter Tr u e for strings that mean true, and enter False for strings that mean false.
The formatter now takes the ActionScript Boolean value and formats it into a String.

Table of Contents

Related product manuals