3 Replies Latest reply on Sep 12, 2006 8:43 AM by ntsiii

    Linking an XML File for Data Insertion

    Randy64
      I'm slowly but surely learning Flex. I'm trying to learn how data is inserted and repeated. I've been able to use the <mx:Script> and CDATA to insert data, but for some reason, even by using the Flex Documentation included in the program, I cannot get data to display from an XML file.

      Here's the code I'm using:
      <mx:Model id="sidebar" source="sidebar.xml"/>
      <mx:ArrayCollection id="myAC" source="{sidebar.category.item}"/>
      <mx:Repeater id="r" dataProvider="{myAC}">
      <mx:LinkButton id="linkbuttons" label="{r.currentItem.name}"/>
      </mx:Repeater>

      My XML file is as follows:
      <?xml version="1.0"?>
      <category>
      <item>
      <name>Chevy and GMC</name>
      </item>
      <item>
      <name>Dodge and Jeep</name>
      </item>
      <item>
      <name>Ford and Mazda</name>
      </item>
      <item>
      <name>Nissan and Isuzu</name>
      </item>
      <item>
      <name>Toyota</name>
      </item>
      </category>

      Thanks in advance for any help.
      Randy