Use schema to describe the XML data source

When you connect to an external XML data source with the XMLConnector component, you need to specify a schema--a schematic representation which describes the structure of the XML document. The schema tells the XMLConnector component how to read the XML data source. The easiest way to specify a schema is to import a copy of the XML file that you're going to connect to, and use that copy as a schema.

  1. Open your web browser and go to www.flash-mx.com/mm/firstapp/products.xml (the location you set for the XMLConnector URL parameter).
  2. Select File > Save As.
  3. Save products.xml to the same location as the FLA file that you're working on.
  4. Select Frame 1 in the main Timeline.
  5. Select the products_xmlcon (XMLConnector) instance beside the Stage.
  6. In the Component inspector, click the Schema tab. Click the Import button (on the right side of the Schema tab, above the scroll pane). In the Open dialog box, locate the products.xml file that you imported in step 3, and click Open. The schema for the products.xml file appears in the scroll pane of the Schema tab.

In the top pane of the Schema tab, select the image element. In the bottom pane, select data type and change the value from <empty> to String. Repeat this step for the description element.