The following example shows how you can toggle the text field on the Flash ActionScript 3.0 ColorPicker control by setting the Boolean showTextField property.
Full code after the jump.
// ActionScript 3.0 /* Requires: * - CheckBox control in Flash library * - ColorPicker control in Flash library */ import fl.controls.CheckBox; import fl.controls.ColorPicker; var checkBox:CheckBox = new CheckBox(); checkBox.selected = true; checkBox.label = "showTextField"; checkBox.addEventListener(Event.CHANGE, checkBox_change); checkBox.textField.autoSize = TextFieldAutoSize.LEFT; checkBox.move(10, 10); addChild(checkBox); var colorPicker:ColorPicker = new ColorPicker(); colorPicker.move(10, 40); addChild(colorPicker); function checkBox_change(evt:Event):void { colorPicker.close(); colorPicker.showTextField = checkBox.selected; colorPicker.open(); }
{ 0 comments… add one now }