要在Flash中为文本输入添加颜色?

要在Flash中为文本输入添加颜色?,flash,components,textinput,Flash,Components,Textinput,我对在Flash中将backgroundColor应用于TextInput组件有一个问题。我有一个叫做LastLayer的MoveClip;在该层中,我使用组件设计了TextInput。现在我想为TexInput添加背景色。谁来指引我。如何添加背景色?提前谢谢 txtUser是我的TextInput组件的实例名。我尝试了此代码,但不起作用: txtUser.setStyle("backgroundColor", "#000000")); 试试这个: var tf:TextFormat = ne

我对在Flash中将backgroundColor应用于TextInput组件有一个问题。我有一个叫做LastLayer的MoveClip;在该层中,我使用组件设计了TextInput。现在我想为TexInput添加背景色。谁来指引我。如何添加背景色?提前谢谢

txtUser是我的TextInput组件的实例名。我尝试了此代码,但不起作用:

txtUser.setStyle("backgroundColor", "#000000"));
试试这个:

var tf:TextFormat = new TextFormat();
tf.size = 25;
tf.color = 0xFF0000;
var ti:TextInput = new TextInput();
ti.textField.background=true;
ti.textField.backgroundColor = 0xffcc00;
ti.x = 100;
ti.y = 100;
ti.width = 200;
ti.height = 30;
ti.text = "your text here";
ti.setStyle("textFormat", tf);
addChild(ti);

好的,我在很多地方更改了文本,如果我这样做,我就无法显示文本。因为我只添加了一次子项。我使用组件设计文本输入,我的文本输入id是txtUser。我试过这个代码.txtUser.setStyle(“backgroundColor”,“000000”)
txtUser.textField.background=true;txtUser.textField.backgroundColor=0x000000