2012-03-10 95 views
0

由於某種原因無法使其工作。任何幫助將不勝感激。dropDownList數組無法正常工作

<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> 

它給了我這個錯誤:

Initializer for 'dataProvider': values of type mx.collections.IList cannot be represented in text.

所以我做了什麼錯?

在此先感謝。讓我知道你是否需要更多的代碼。

回答

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> 
+0

SWEET!謝謝!! – nebmuzik 2012-03-10 04:27:15

+0

@nebmuzik,歡迎兄弟.. – 2012-03-10 04:29:38