8 Replies Latest reply on Jun 14, 2006 1:37 PM by ntsiii

    Question about get web service result in actionscript and convert data format

    TigerLittle Level 1
      Hi, All

      I have question about how to get dataset from web services and put it in tree structure. I have 2 questions about this:
      1, How can I get data correctly in actionscript?

      I have no problem to get data by
      <mx:ArrayCollection id="acFolder" source="{mx.utils.ArrayUtil.toArray(MyGServices.getFolder.lastResult)}" />
      And display in datagrid.

      But when I try to use
      public function handleFolderContents(event:mx.rpc.events.ResultEvent):void{
      acData=new ArrayCollection(arData);
      Seems I can’t get data, it always say:
      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      2, how to convert data format
      I get data from web service and want to convert it to tree structure, as mention below:
      I get:

      Convert to:
      <mx:XMLList id="treeData">
      <node label="Production1" data="111">
      <node label="Production2" data="222"/>

      Please help me.