dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Change Font Color in TextArea

  1. #1
    Free Stock Photos emo_boy's Avatar
    Join Date
    Nov 2001
    Posts
    517

    Change Font Color in TextArea

    Sounds simple but there is a little more to it. So I have a textArea that gets populated using a Combo Box, the Combo Box is getting populated via XML (XML Connector), how can I style the textArea?

    The only style command that works in the textArea is:
    Code:
    textAreaName.setStyle("backgroundColor", 0xFFBBBB);
    However when I try to change fontSize using the following, it doesn't work:
    Code:
    textAreaName.setStyle("fontSize", 32);
    I think it may have to with the Combo Box populating the textArea. Because I can get the font size to change when it first loads, but when I select a different "item" from the Combo Box all of a sudden the textArea font size goes back to default. How do I fix this?

  2. #2
    Senior Member indogo's Avatar
    Join Date
    Dec 2005
    Posts
    282
    As far as I recall any style changes will only affect what is already there..any new text will use the text area original settings..are you using html mode?...
    mike

  3. #3
    Free Stock Photos emo_boy's Avatar
    Join Date
    Nov 2001
    Posts
    517
    Quote Originally Posted by indogo
    As far as I recall any style changes will only affect what is already there..any new text will use the text area original settings..are you using html mode?...
    mike
    Yeah, that is exactly what's happening here. How do you change the textArea original settings?


    I'm using HTML is set to true for the textArea. Any suggestions?

  4. #4
    Senior Member indogo's Avatar
    Join Date
    Dec 2005
    Posts
    282
    In the properties dialogue for the textarea.....

    when encountering this problem in the past I added a font tag with the populating script (combo box)...think it was the easiest solution.

    mike

  5. #5
    Free Stock Photos emo_boy's Avatar
    Join Date
    Nov 2001
    Posts
    517
    But I didn't think you could change the font color/size in the properties dialogue for a textArea, at least I can't. For a textField yeah but not a textArea.

    And what do you mean by adding a font tag? In the XML file?

  6. #6
    Senior Member indogo's Avatar
    Join Date
    Dec 2005
    Posts
    282
    Somewhere between xml and the textarea..

    mike

  7. #7
    Free Stock Photos emo_boy's Avatar
    Join Date
    Nov 2001
    Posts
    517
    I figured it out.

    Code:
    _root.taAddress.text = "<font size='16' color='#3366cc'>"+row_obj.addr+"</font>";
    That will change the color and font size of the text inside a TextArea which is being populated from DataGrid via XML.

  8. #8
    Senior Member indogo's Avatar
    Join Date
    Dec 2005
    Posts
    282
    Yep sounds about right.....html textareas are a bit more fiddly

    nice one

    mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center