Flash cs5.5调整单选按钮组件



如何调整Flash CS5.5自带的单选按钮组件的大小?

默认的外观非常小。这同样适用于单选按钮标签,它也相当小。

Thanks in advance

您可以在库中找到图形资源。文件夹名称为"Component Assets" -> "RadioButtonSkins"。请注意,有许多影片剪辑包含了单选按钮

的各种状态。

对于单选按钮的文本/标签部分,您必须通过代码来完成。下面是一个您可以使用的示例函数:

function styleRadioButton(rb:RadioButton, myTextFormat:TextFormat):void {
    rb.setStyle("embedFonts", true); //if you want to use an embedded font
    rb.setStyle("textFormat", myTextFormat); //set the text format
    rb.setStyle("antiAliasType", AntiAliasType.ADVANCED); //if you want smoother looking fonts
    rb.textField.autoSize = TextFieldAutoSize.LEFT; //if you want the label to automatically grow
}

如果你有一个名为myRadio的复选框实例,你可以这样做:

var textFormat:TextFormat = new TextFormat("Arial", 24, 0xFF0000); //make a red, 24px Arial text format
styleCheckBox(myRadio,textFormat);

现在,您还可以做的一件更简单的事情是将您的单选按钮放在MovieClipSprite容器内并缩放该容器。要做到这一点:

1 -在舞台上放置一个单选按钮的实例

2 -选择新创建的实例,按F8(或修改->转换为符号)

缩放新制作的影片剪辑

最新更新