title: Flex 3 - How to read data dynamically from XML
body: <p>I'm new at Flex and I wanted to know how to read an xml file to pull its data into a chart, using Flex Builder 3.</p>
  
  <p>Even though I've read and done some tutorials, I haven't seen any of them loading the data dynamically. For example, I'd like to have an xml like the following:</p>
  
  <pre><code>&lt;data&gt;
      &lt;result month="April-09"&gt;
          &lt;visitor&gt;
              &lt;value&gt;8&lt;/value&gt;
              &lt;fullname&gt;Brian Roisentul&lt;/fullname&gt;
              &lt;coid&gt;C01111&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;15&lt;/value&gt;
              &lt;fullname&gt;Visitor 2&lt;/fullname&gt;
              &lt;coid&gt;C02222&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;20&lt;/value&gt;
              &lt;fullname&gt;Visitor 3&lt;/fullname&gt;
              &lt;coid&gt;C03333&lt;/coid&gt;
          &lt;/visitor&gt;
      &lt;/result&gt;
      &lt;result month="July-09"&gt;
          &lt;visitor&gt;
              &lt;value&gt;15&lt;/value&gt;
              &lt;fullname&gt;Brian Roisentul&lt;/fullname&gt;
              &lt;coid&gt;C01111&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;6&lt;/value&gt;
              &lt;fullname&gt;Visitor 2&lt;/fullname&gt;
              &lt;coid&gt;C02222&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;12&lt;/value&gt;
              &lt;fullname&gt;Visitor 3&lt;/fullname&gt;
              &lt;coid&gt;C03333&lt;/coid&gt;
          &lt;/visitor&gt;
      &lt;/result&gt;
      &lt;result month="October-09"&gt;
          &lt;visitor&gt;
              &lt;value&gt;10&lt;/value&gt;
              &lt;fullname&gt;Brian Roisentul&lt;/fullname&gt;
              &lt;coid&gt;C01111&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;14&lt;/value&gt;
              &lt;fullname&gt;Visitor 2&lt;/fullname&gt;
              &lt;coid&gt;C02222&lt;/coid&gt;
          &lt;/visitor&gt;
          &lt;visitor&gt;
              &lt;value&gt;6&lt;/value&gt;
              &lt;fullname&gt;Visitor 3&lt;/fullname&gt;
              &lt;coid&gt;C03333&lt;/coid&gt;
          &lt;/visitor&gt;
      &lt;/result&gt;   
  &lt;/data&gt;
  </code></pre>
  
  <p>and then loop through every "visitor" xml item and draw their values, and display their "fullname" when the mouse is over their line.</p>
  
  <p>If you need some extra info, please let me just know.</p>
  
  <p>Thanks,</p>
  
  <p>Brian</p>