Copy link to clipboard
Copied
I'm trying to change the background color of a TextArea Component. Does anyone know how to do this?
function processXML(e:Event):void {
var strTextBox:String;
myText.visible=true;
myText.setStyle("contentBackgroundColor", 0x000000); //Does not work..nor does myText.setStyle("backgroundColor",0x000000);
myXML = new XML(e.target.data);
strTextBox = "<a href='" + myXML.Branch[0].linkURL + "'> More Info...</a>";
myText.htmlText=strTextBox;
}
try:
function processXML(e:Event):void {
var strTextBox:String;
myText.visible=true;
myText.textField.background=true;myText.textField.backgroundColor=0x000000;
myXML = new XML(e.target.data);
strTextBox = "<a href='" + myXML.Branch[0].linkURL + "'> More Info...</a>";
myText.htmlText=strTextBox;
}
Copy link to clipboard
Copied
try:
function processXML(e:Event):void {
var strTextBox:String;
myText.visible=true;
myText.textField.background=true;myText.textField.backgroundColor=0x000000;
myXML = new XML(e.target.data);
strTextBox = "<a href='" + myXML.Branch[0].linkURL + "'> More Info...</a>";
myText.htmlText=strTextBox;
}
Copy link to clipboard
Copied
Many, Many, Many thanks!
Is there a way to handle the font of the text, or am I suppose to apply style sheets?
Again, thanks.
Copy link to clipboard
Copied
you can use stylesheets or apply textformat instance(s).
Copy link to clipboard
Copied
I tried the following
var newFormat:TextFormat = new TextFormat;
newFormat.bold = true;
newFormat.size = 18;
newFormat.color = 0xFFFFFF; //I'm wanting white font on black background.
//apply the format:
myText.textField.defaultTextFormat=newFormat;
myText.visible=true;
myText.textField.background=true;
myText.textField.backgroundColor=0x000000;
I don't see the white text.. What might I be missing?
Regards,
Kevin
Copy link to clipboard
Copied
for that one you have use styles:
var newFormat:TextFormat = new TextFormat;
newFormat.bold = true;
newFormat.size = 18;
newFormat.color = 0xFFFFFF; //I'm wanting white font on black background.
//apply the format:
myText.setStyle("textFormat",newFormat);
myText.visible=true;
myText.textField.background=true;
myText.textField.backgroundColor=0x000000;
Copy link to clipboard
Copied
Mucho Garcias!
If California wasn't broke, I'd tell them to send you some $.
I appreciate the help.
Copy link to clipboard
Copied
you're welcome.
(and i'm paying ridiculous taxes in california already. they need to pay everyone less.)
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more