2 Replies Latest reply on Mar 22, 2007 3:58 PM by chrisisme

    HTTPService with only one XML result

      Working through and expanding on some tutorials I ran across an issue I can't resolve. Here is the brief code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" initialize="myService.send()">

      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;

      private var myData:ArrayCollection;

      private function resultHandler(event:ResultEvent):void {
      myData = event.result.users.user;

      <mx:HTTPService id="myService" url=" http://localhost/httpservice/request.php" result="resultHandler(event)"/>

      <mx:DataGrid dataProvider="{myData}"/>


      This works great... When there is more than one result returned by the php service. So I get that this is because I am using an ArrayCollection. Well then, how do you provide the flexability to have 1, 1+n, or no results returned from the service without chocking the "TypeError: Error #1034: Typre coercion failed:..."? This just seems wacky.