组件->User Interface->ColorPicker拉到库中
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
var clp:ColorPicker=new ColorPicker();
var wb_txt:TextField=new TextField();
var wbys:TextFormat=new TextFormat();
addChild(wb_txt);
addChild(clp);
wb_txt.text="这是设置颜色板";
wbys.size=14
wb_txt.setTextFormat(wbys);
wb_txt.x=200;
wb_txt.y=200;
clp.x=wb_txt.x+wb_txt.width+clp.width;
clp.y=wb_txt.y;
clp.addEventListener(ColorPickerEvent.CHANGE,cd);
function cd(event):void
{
var asd:String = new String();
asd = "0x"+clp.hexValue;
trace(asd);
wbys.color=asd;//clp.selectedColor;
trace(clp.selectedColor);
trace(clp.hexValue);
wb_txt.setTextFormat(wbys);
}
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
var clp:ColorPicker=new ColorPicker();
var wb_txt:TextField=new TextField();
var wbys:TextFormat=new TextFormat();
addChild(wb_txt);
addChild(clp);
wb_txt.text="这是设置颜色板";
wbys.size=14
wb_txt.setTextFormat(wbys);
wb_txt.x=200;
wb_txt.y=200;
clp.x=wb_txt.x+wb_txt.width+clp.width;
clp.y=wb_txt.y;
clp.addEventListener(ColorPickerEvent.CHANGE,cd);
function cd(event):void
{
var asd:String = new String();
asd = "0x"+clp.hexValue;
trace(asd);
wbys.color=asd;//clp.selectedColor;
trace(clp.selectedColor);
trace(clp.hexValue);
wb_txt.setTextFormat(wbys);
}