0 Replies Latest reply on May 2, 2011 5:06 AM by Loic.Aigon

    Issue extending a combobox (cbx skin applied to list item)

    Loic.Aigon Adobe Community Professional

      Hi all,

       

      I am trying to extend a combobox so I can have more abilities to style list items depending on the dataprovider datas.

       

      I do extend the class like this :

      package custom
      {
              import mx.controls.ComboBox;
              import mx.controls.listClasses.ListBase;
              
              public class BBXDD extends ComboBox
              {
                      public function BBXDD()
                      {
                              super();
                      }
                      
                      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
                              super.updateDisplayList(unscaledWidth, unscaledHeight);
                              
                              //figure out if this itemRenderer is selected
                              if(ListBase(owner).isItemSelected(data))
                              {
                                      setStyle('color', "red");
                              }
                                      //otherwise, return the label to its regular state
                              else
                              {
                                      setStyle('color', "yellow");
                              }
                      }
              }
      }
      

       

      But when the air app is run, the list item gets the combobox skin ???

       

      http://data.imagup.com/8/1118997235.png

       

      Do you have any ideas of what is wrong ?

       


      TIA,

       

      Loic