Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Can';t使用xmldocument填充我的下拉列表_Actionscript 3_Apache Flex_Flex4.5 - Fatal编程技术网

Actionscript 3 Can';t使用xmldocument填充我的下拉列表

Actionscript 3 Can';t使用xmldocument填充我的下拉列表,actionscript-3,apache-flex,flex4.5,Actionscript 3,Apache Flex,Flex4.5,为什么不能填充我的下拉列表。 我在家做录像。 值不在nameSaleChoose.how中。 请帮帮我 我想在下拉列表中显示LocalDesc <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns

为什么不能填充我的下拉列表。 我在家做录像。 值不在nameSaleChoose.how中。 请帮帮我

我想在下拉列表中显示LocalDesc

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="320" height="480" 
    creationComplete="initApp()">
<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import mx.controls.Alert;
        import mx.rpc.events.FaultEvent;
        import mx.rpc.events.ResultEvent;
        import spark.events.IndexChangeEvent;
        [Bindable]
        private var nameSaleChoose:ArrayCollection;
        protected function service_resultHandler(event:ResultEvent):void
        {
            // TODO Auto-generated method stub  
            nameSaleChoose = event.result as ArrayCollection;
        }
        private function initApp():void
        {
            service.GetXml("SELECT PositionCode,LocalDesc 
                   FROM StaffPosition WHERE PositionCode IN ('00000','00021')");
        }
    ]]>
</fx:Script>
<fx:Declarations>
    <s:WebService id="service" 
                  wsdl="http://192.168.1.25/service.asmx?wsdl" 
                  result="service_resultHandler(event)"
                  > 
    </s:WebService>
</fx:Declarations>
<s:DropDownList id="dropDownList" x="35" y="38" width="164" 
     dataProvider="{nameSaleChoose}" labelField="LocalDesc">
</s:DropDownList>

此xml:ReturnfromWeb服务

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
  www.w3.org/2001/XMLSchema-instance">
<soap:Body>
 <GetXmlResponse xmlns="http://tempuri.org/">
  <GetXmlResult>
    <NewDataSet xmlns="">
      <Table>
        <PositionCode>00000</PositionCode>
        <LocalDesc>Administrator</LocalDesc>
      </Table>
      <Table>
        <PositionCode>00021</PositionCode>
        <LocalDesc>saleman</LocalDesc>
      </Table>
     </NewDataSet>
    </GetXmlResult>
  </GetXmlResponse>
</soap:Body>
</soap:Envelope>

00000
管理员
00021
销售员

原因是您的结果是XML格式的,您尝试在ArrayCollection中强制转换它。 您应该使用XMLListCollection类