发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
package {
import fl.controls.*;
import fl.managers.*;
import flash.display.*;
import flash.text.*;
public class Test extends Sprite {
public function Test() {
//按钮Button
var btn:Button=new Button();
btn.x=50;
btn.y=50;
btn.alpha=10;//虽然有效范围为0-1,但增大此数值可是按钮变为不透名
addChild(btn);
var myformat:TextFormat=new TextFormat();
myformat.size=12;
myformat.color=0xFF0000;
//StyleManager.setStyle("textFormat",myformat);//设定全局组件样式
StyleManager.setComponentStyle(Button,"textFormat",myformat);
//文本框Textarea
var txt:TextArea=new TextArea();
txt.x=50;
txt.y=200;
txt.width=200;
txt.height=100;
txt.text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce vitae turpis id nibh suscipit tincidunt. Quisque nulla dui, elementum eget, rutrum in, ultricies nec, erat. Donec ante turpis, lacinia eget, semper ac, consequat eget, neque. Maecenas eleifend pharetra quam. Quisque suscipit nibh a ipsum. Donec sit amet mi eu ligula volutpat imperdiet. Ut quis velit quis lectus laoreet eleifend. Aliquam pulvinar lorem. Cras ultrices felis sit amet urna. Cras viverra porttitor est. Nulla justo. Sed scelerisque.";
addChild(txt);
var myformat2:TextFormat=new TextFormat();
myformat2.bold=true;
//StyleManager.setStyle("textPadding",15);//设定全局组件样式
StyleManager.setComponentStyle(TextArea,"textFormat",myformat2);
StyleManager.setComponentStyle(TextArea,"textPadding",10);
}
}
}
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。