hi Tim,

try this (solves yellow can't be selected problem):

private function addColor(event:Event):void {
    cp.visible = false;
    //
    var itm:* = cp.dataProvider[ cp.selectedIndex ];
    Util.traceValue(itm);
    //
    colorArray.push({label:itm.label, color:itm.color});
    messageText.setStyle('color',itm.color);
    messageText.text = itm.label + " has been added to the comboBox.";
    cbxColor.open();
    btnAddColor.setFocus();               
}

things I changed:

1. listen to ColorPicker's "close" event, instead of "change" event

2. get the value from cp using "selectedIndex" instead of "selectedItem", this will ensure you get the right value out of the picker.

regarding the focus around cp after it's set invisible, can't figure out it, but in the past when I ran into this, I usually set focus to a textfield off the stage or completely turn off the focus.


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to