6 Replies Latest reply on Nov 27, 2007 2:12 PM by bpapau

    HTTPService Help

    bpapau Level 1
      Hi everyone,

      I hate to make another topic about this, but I'm at my wits end getting this to work. Been 2 days and I haven't made any progress. I've included a full version of my code below.

      I'm just trying to get a proof of concept going to collect this chart data, but I can't seem to get it to work using AS. I've been trying to debug it, but all I get is a "Source not found" eventually. I have confirmed that the data is correct (the debug tells me that much) but why it wont display on the chart is byond me....

      <?xml version="1.0" encoding="utf-8"?>
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      import mx.charts.chartClasses.Series;
      import mx.charts.series.LineSeries;
      import mx.charts.LineChart;
      import mx.containers.Panel;
      import mx.containers.Canvas;
      import mx.events.*;
      import mx.rpc.events.*;
      import mx.controls.Alert;

      private function useHTTPservice(param:Object,URL:String,result_fxn:Function=null,result_format:String="e4x "):void
      var contact:HTTPService = new HTTPService();
      contact.resultFormat = result_format;
      contact.url = URL;
      contact.method = "POST";
      if (result_fxn != null ) {
      contact.addEventListener("result", result_fxn);
      contact.addEventListener("fault", httpFault);

      private function dataReceived(evt:ResultEvent):void
      var MainCanvas:Canvas = new Canvas;
      MainCanvas.percentHeight = 100;
      MainCanvas.percentWidth = 100;

      var newPanel:Panel = new Panel;
      newPanel.percentHeight = 100;
      newPanel.percentWidth = 100;

      var Chart:LineChart = new LineChart;
      Chart.percentHeight = 100;
      Chart.percentWidth = 100;
      Chart.dataProvider = evt.result.point;

      var newSeries:Series = new Series;


      var Line:LineSeries = new LineSeries;
      Line.yField = "CO2_BDROOM";



      private function httpFault(evt:FaultEvent):void

      private function configkiosk(event:ResultEvent):void
      var DB_Connect:Object = new Object;
      var URL:String = new String;
      URL = ""



      <mx:HTTPService id="config" url=" http://localhost/KIOSK_CONFIG.xml" result="configkiosk(event)" />