1 Reply Latest reply on Apr 18, 2008 6:52 PM by Michael Borbor

    HTTP Service Using Results

    mrhalverson
      I am trying to access data binded to an object from a result of an httpservice. In the below example of the problem I am having, if var = Info.XMLMainTag.XMLSubTag; is removed the httpservice retrieves the data in lastresult and the Bind function is fired. But if var = Info.XMLMainTag.XMLSubTag; is put in, the Bind function is never called and from debugging it seems like the httpservice is never executed as the lastresult object is always null. I'm confused as to why this would happen? Any help is appreciated, thanks!

      <mx:Window xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#E7E7E7">

      <mx:HTTPService id="httpCreateJob" url=" http://localhost/debug/php/CreateJob.php" useProxy="false" method="POST" result="Bind(event);"/>
      <mx:Button label="Create Job" click="fncCreateJob();"/>

      <mx:Script>
      <![CDATA[

      import mx.rpc.events.ResultEvent;
      public var Info:Object;

      private function fncCreateJob():void {
      httpCreateJob.send();

      var Blah:String;
      var = Info.XMLMainTag.XMLSubTag;
      }

      private function Bind(event:ResultEvent):void {
      Info = event.result.CreateJobsResult;
      }

      ]]>
      </mx:Script>

      </mx:Window>