title: AS3 Set Combobox background color?
body: <p>I have the following code which styles my comboBox drop down, but I can't seem to get a background color to work. I've used // comments to show which lines it doesn't like:</p>
  
  <pre><code>var myTextFormat:TextFormat = new TextFormat();
  myTextFormat.font = "Arial";
  myTextFormat.color = 0xFFFFFF;
  myTextFormat.size = 10;
  myTextFormat.background = true; // Doesn't like this line
  myTextFormat.backgroundColor = 0xFFFFFF; // Doesn't like this line
  
  var m = 0;
  function comboBoxChange(e:Event):void {
  var scriptVars:URLVariables = new URLVariables();
      trace("YOU CHANGED ME!!!"); 
      //scriptVars["InstructorName" + [m]] = myXML.Instructors.InstructorName[m];
      trace(e.target.selectedItem.label);
  
  
      //Change the comboBox color if Instructor selected
      // Go back to plain if no Instructor
      if (e.target.selectedIndex == 0){
          trace("EMPTY");
          e.target.transform.colorTransform = new ColorTransform;
      }
      else
      {
          // Shade of black indicates slot allocated to Instructor
          my_color.color = 0x002222;
          //e.target.transform.colorTransform = my_color;
          e.target.parent.alpha = 1;
          e.target.textField.setStyle ("textFormat",myTextFormat);
      }
  
  }
  </code></pre>