0 Replies Latest reply on Sep 7, 2007 2:26 PM by sm689

    Linking xml dynamically with mxml


      I am trying to create an application that uses an xml to source data for a chart. My mxml code is as follows :

      <!-- Simple example to demonstrate the HttpService -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      width="100%" height="100%" creationComplete="srv.send()">
      <mx:HTTPService id="srv" url="http:/[$servername]/data.xml" />

      <mx:Panel title="Line Chart">
      <mx:LineChart id="chart"
      dataProvider="{srv.lastResult.data.result}" >
      <mx:CategoryAxis categoryField="slot"/>
      <mx:LineSeries yField="usage" name="Usage"/>


      In [$servername] I have the name fo my server. data.xml looks like :
      <result slot="19:00-20:00">
      <result slot="20:00-21:00">
      <result slot="21:00-22:00">
      <result slot="22:00-23:00">

      This compiles but whenever I change the xml I need to recompile the mxml for it to be able to pick up the latest xml data even though I am using HTTPService. How do I link an xml dynamically with mxml so that it picks up the actual xml available instead of using the data in xml when mxml was last compiled?

      Thanks in advance