Download Print this page

MACROMEDIA FLASH MX 2004-DATA Tutorials Manual page 15

Advertisement

Note: The field names must exactly match the names of their corresponding properties within the
XMLConnector component (@date = date, @billable = billable, @duration = duration), including
capitalization.
Select the Date field that you just created. Select the encoder setting and change it to
19.
DateToNumber.
Note: The DataSet component needs to store date values in their numeric equivalents so that they
can be sorted correctly. This encoder converts a Date into a Number whenever the value is set. It
converts a Number into a Date whenever the value is accessed.
With the Date field still selected, double-click the Formatter field in the Component Inspector
20.
and choose Date from the pop-up menu.
Double-click the Formatter Options field in the Component Inspector.
21.
In the Date Formatter Settings dialog that appears, enter MM-DD-YYYY in the Format
22.
text box.
Drag a DataGrid component to the Stage, and in the Property inspector enter the instance
23.
name timeInfo_grd.
In the Component inspector, click the Bindings tab. Create a binding between the DataGrid
24.
component's
dataProvider
Set the direction to In.
Add another binding between the DataGrid component's
25.
DataSet component's
Drag a Button component to the Stage, and give it the instance name loadData_btn in the
26.
Property inspector.
In the Component inspector, click the Parameters tab. In the Label field, type Load Data.
27.
With the button still selected on the Stage, open the Behaviors Panel (Window > Development
28.
Panels > Behaviors).
Click the Add Behavior (+) button, and select Data > Trigger Data Source. In the Trigger Data
29.
Source dialog box, select the timeInfo_con component, and click OK.
Save the file in the same folder where the data.xml file resides.
30.
Run the application, and click the Load Data button.
31.
The XML data is retrieved, converted, and loaded into the DataSet component. The binding
between the DataSet and the DataGrid copies the data into the Grid for display.
property and the DataSet component's
property.
selectedIndex
dataProvider
property and the
selectedIndex
Create the user interface
property.
15

Hide quick links:

Advertisement

loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-DATA and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx 2004 - actionscript