0

I have a little bit of a problem here. I am making a kind of chat application in Flash CS5, using Action Script 3, and I am trying to make URLs that appear in the main chat textbox (where all of the things that other people have said come up), which is a TextArea component, be converted into HTML link tags. I have this working, but the problem I am facing now is that the links appear black. I want them to appear with an underline, and blue text. I am formatting the TextArea with TextFormat, and I am using some of the functionality that is only available in TextAreas, so I cannot use plain dynamic labels. I have also tried using the style attribute of the link tag, but that didn't do anything.

How can I change the formatting for the link tags to appear blue and with an underline?

My current code for changing the links to HTML link tags looks like this:

txtOutput.htmlText += replace(/(?:http|https):\/\/\S*/g, function ():String
{
    return '<a href="' + arguments[0] + '">' + arguments[0] + '</a>'
});
tomb
  • 1,817
  • 4
  • 21
  • 40

1 Answers1

0

have a look at style sheets you can implement hyperlink styles form there.
update: The textArea has a textField property. try applying he style sheet to that.

Community
  • 1
  • 1
neil manuell
  • 225
  • 2
  • 10
  • I tried stylesheets but the TextArea compontent does not support them. As far as I know it only supports `TextFormat`. – tomb Feb 01 '13 at 06:06
  • are you using flex? or is this the Flash component? – neil manuell Feb 01 '13 at 11:59
  • grab the internal textField by using TextArea.textField property, and apply styleSheet. Both Flex and Flash verstions have this property – neil manuell Feb 01 '13 at 12:16
  • @niel_manuell This is the Flash compontent. I will try the `styleSheet` property, but just wondering... will `TextFormat` and `styleSheet` work in conjunction? – tomb Feb 02 '13 at 10:16