dropDownList,数组不起作用

时间:2012-03-10 04:07:43

标签: flash flex flash-builder

由于某种原因无法使其发挥作用。任何帮助将不胜感激。

    <fx:Declarations>
<s:ArrayList id="mathChoices">
<fx:String>ADD</fx:String>
<fx:String>SUBTRACT</fx:String>
<fx:String>MULTIPLY</fx:String>
<fx:String>DIVIDE</fx:String>
 </s:ArrayList>

</fx:Declarations>

然后:

<s:DropDownList id="math_selector" includeIn="Intro" x="49" y="241" dataProvider="mathChoices"
                prompt="Pick from..." requireSelection="true"></s:DropDownList>

它给了我这个错误:

  

'dataProvider'的初始化程序:mx.collections.IList类型的值无法表示    文本。

那我做错了什么?

提前致谢。如果您需要更多代码,请与我们联系。

1 个答案:

答案 0 :(得分:0)

   Edit your dataprovider as {mathChoices as IList}

   here is the code.

   <s:DropDownList id="math_selector"  x="49" y="241" 
   dataProvider="{mathChoices as IList}"                
   prompt="Pick from..." requireSelection="true">   
   </s:DropDownList>
相关问题