Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Flash CS5 How does one change background color in TextArea Component

Guest
Aug 25, 2010 Aug 25, 2010

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;
}

TOPICS
ActionScript
5.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 25, 2010 Aug 25, 2010

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;
}

Translate
Community Expert ,
Aug 25, 2010 Aug 25, 2010

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;
}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 25, 2010 Aug 25, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2010 Aug 25, 2010

you can use stylesheets or apply textformat instance(s).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 25, 2010 Aug 25, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2010 Aug 25, 2010

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;


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 26, 2010 Aug 26, 2010

Mucho Garcias!

If California wasn't broke, I'd tell them to send you some $.

I appreciate the help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 26, 2010 Aug 26, 2010
LATEST

you're welcome.

(and i'm paying ridiculous taxes in california already.  they need to pay everyone less.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines