7 Replies Latest reply on May 1, 2010 12:33 AM by Loic.Aigon

    object icon in Array for dataProvider of a ComboBox

    Loic.Aigon Adobe Community Professional



      I am trying to get a ComboBox whose items consist in a label and an icon.


      If I place static code, it runs well, I get my icon and label.



      <mx:ComboBox ... >
               <mx:Object label="Français" icon="@Embed(source='assets/pays/France.png')" />



      BUT if I try to get it dynamically, I can get nothing but the labels :



      <mx:ComboBox ... dataProvider="{getlanguages()}"/>

      and here is my  function getlanguages() :

      public function getlanguages():Array{
           var myList:Array=["France"];
           var lang:Array = [];
           for(var i:int = 0; i<myList.length; i++){
                var theLanguage:Object= {
           return lang;


      Any  ideas why ?


      TIA Loic