Reputation: 1860
I have an issue with applying backgroundColor to a TextInput component in Flash. I have a MoveClip called LastLayer; in that Layer i designed the TextInput by using components. Now I want to add the background color for the TexInput. Anyone guide me. How can i add the background color? Thanks in Advance!
txtUser is the instance name for my TextInput component. I tried this code, but it does not work:
txtUser.setStyle("backgroundColor", "#000000"));
Upvotes: 0
Views: 1174
Reputation: 1316
Try this:
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);
Upvotes: 1