var key:int = resultID+1;
resultID = key;
var text:Text = new Text();
text.text = " " ;
var checkBox:CheckBox = new CheckBox();
checkBox.id = key+"";
checkBox.label = resultLabel;
checkBox.addEventListener(Event.CHANGE,function(evt:Event):void{
var check:CheckBox = evt.currentTarget as CheckBox;
for(var r:int=0; r<resultArr.length; r++){
if(resultArr.getItemAt(r).id == check.id){
if(check.selected){
resultArr.getItemAt(r).isCheck =true ;
}else{
resultArr.getItemAt(r).isCheck =false ;
}
}
}
});
var colorP:ColorPicker = new ColorPicker();
colorP.id = key+"";
colorP.addEventListener(ColorPickerEvent.CHANGE,function(evt:ColorPickerEvent):void{
var color1:ColorPicker = evt.currentTarget as ColorPicker;
for(var r:int=0; r<resultArr.length; r++){
if(resultArr.getItemAt(r).id == color1.id){
resultArr.getItemAt(r).color = color1.selectedColor;
}
}
});
var hbox:HBox = new HBox();
hbox.addChild(text);
hbox.addChild(checkBox);
hbox.addChild(colorP);
this.vbox.addChild(hbox);
resultArr.addItem({id:key,label:resultLabel,data:xml,isCheck:false,color:colorP.selectedColor});
(转)flex checkbox 选中
最新推荐文章于 2019-07-23 00:23:24 发布