MACROMEDIA FLASH MX 2004-DATA Tutorials Manual - page 12
12
XML Tutorial: Timesheet (Flash Professional Only)
Create the user interface
You will begin by creating a user interface, which displays the information in the XML file.
1.
Create a new Flash document using Flash MX Professional 2004. Make sure your computer is
connected to the Internet.
2.
From the Components panel, drag an XMLConnector component to the Stage. In the Property
inspector, enter the instance name timeInfo_con.
3.
In the Component inspector or the Property inspector, click the Parameters tab. For the URL
parameter, enter data.xml, and for the Direction parameter, select Receive from the pop-up
menu.
4.
From the Components panel, drag a DataSet component to the Stage. In the Property
inspector, enter the instance name timeInfo_ds.
5.
On the Stage, select the XMLConnector component. In the Component inspector, click the
Schema tab. Select the
results:XML
property, then click the Import a Schema from a Sample
XML File button, at the upper right of the Schema tab.
Note: Alternatively, you can select Import XML Schema from the Component inspector title bar
menu.
6.
Browse to where you saved the data.xml file, and select the file.
The Schema tab now shows the structure of the data in the file. The
row
node is mapped to an
ActionScript array of anonymous objects, because it repeats several times within the XML file.
Any subnodes or attributes directly under the row node are considered properties of the
anonymous objects contained within the array.
For more information about how Flash translates XML documents into an internal schema
representation, see the “Data Integration” chapter in Using Flash (in Flash, select Help >
Using Flash).