2 Replies Latest reply on Oct 4, 2009 5:56 AM by Michael19871987

    textArea

    Michael19871987

      Hi guys, i got a prom about TextFlow inside a txtArea.

       

      that's my code

      var t2:TextFormat = new TextFormat();

       

      t2.font = "Arial";
      t2.size = "14";
      t2.leading = "2";
      t2.leftMargin = "0";
      for (var i:int = 0; i <10; ++i){
          this.h1.setStyle("textFormat", t2);
          h1.htmlText += "<img src='h1.jpg' align='left' vspace='0' hspace='2'>Hi, How're u doin?</img>";
      }

       

      U can see the output on the pic.

       

      It just uses the TextFormat for the last line and why are the spaces to the first pics big and get lower and lower to the followin ones?

       

      Can smbd tell me how to solve that prom?

       

      Thanks in advance

        • 1. Re: textArea
          Ned Murphy Adobe Community Professional & MVP

          You can try setting the TextFoemat on the inner textField of the component instead of using setStyle...

           

          h1.textField.setTextFormat(t2);

          • 2. Re: textArea
            Michael19871987 Level 1

            Hi  

            It worked another way.

            I wrote a lil workaround:

             

            var g:string;

            h1.addEventListener(MouseEvent.click, h1);

            function h1(event:MouseEvent):void{

            g += 'the html text includin the pic';

            txtArea.htmlText = g;

            }

             

            but it only sets the pic to the beginnin of the text. How can i make it possible to get it within the textflow?

             

            Thanks guys