2014. 8. 27. 18:34

Checkbox label 에 text 스타일 적용하기


import fl.controls.CheckBox;

var checkBox:CheckBox = new CheckBox();
checkBox.x = 100;
checkBox.y = 100;
addChild(checkBox);

var myFormat:TextFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.size = 14;
myFormat.bold = true;
myFormat.color = 0xFF0000; //red

checkBox.textField.autoSize = TextFieldAutoSize.LEFT;
checkBox.setStyle("textFormat", myFormat);
checkBox.label = "Hello world, it's a beautiful day! Isn't it?";