0 Replies Latest reply on Sep 29, 2011 8:13 AM by Chrestang

    TLF and multiple links in a textarea or globaly link formating

    Chrestang

      Hi

       

      I found the TLF and I want to add the same link style behavior for all text areas in my project. I add text dynamical to theese textareas, and I also want to use formating like bold asf.

       

      I can do it like this, but then I have to add all the code for all the links each time. Is there a better way?

       

      var markup:String = "

      <p fontSize="14">

      The

      <a href="http://www.google.com" target="_blank">

      <linkActiveFormat><TextLayoutFormat color="#0000cc" textDecoration="underline"/></linkActiveFormat><linkHoverFormat><TextLayoutFormat color="#cc0000" textDecoration="underline"/></linkHoverFormat><linkNormalFormat><TextLayoutFormat color="#0000cc" textDecoration="underline"/></linkNormalFormat>

      quick brown fox</a> jumps <span fontWeight="bold">over</span> the lazy dogg.</p>";

       

      richTxt.textFlow = TextFlowUtil.importFromString(markup);

       

      <s:TextArea id="richTxt" editable="false"                                        horizontalCenter="0" verticalCenter="0"></s:TextArea>

       

       

      I can also do it like this: http://blog.flexexamples.com/2009/03/17/globally-styling-anchor-tags-on-a-textview-control -in-flex-gumbo/comment-page-1/#comment-10009

      But when I add dynamic text it dont work in one way and in another way the other styling dont work.