设置按钮式样 文本格式

// Import the required component classes.
import fl.controls.Button;

// Create a new TextFormat object which will be used for the button's label.
var myTextFormat:TextFormat = new TextFormat();
myTextFormat.bold = true;
myTextFormat.color = 0xFF0000;

/* Create a new Button component instance and set the textFormat style to the
   TextFormat object created earlier. */
var myButton:Button = new Button();
myButton.label = "Click me";
myButton.move(10, 10);
myButton.setStyle("textFormat", myTextFormat);
addChild(myButton);

全文:http://www.adobe.com/cn/devnet/flash/quickstart/button_component_as3.html#articlecontentAdobe_numberedheader_4

posted @ 2015-08-28 22:54  stma  阅读(296)  评论(0编辑  收藏  举报