Skip to main content
Participating Frequently
April 6, 2009
Question

Paragraph align

  • April 6, 2009
  • 1 reply
  • 606 views

Hello,

I use this code from Livedocs Documentation:

/////////////////////////////////////////////////////////////////////////////////////////////////////////

            var config:Configuration = new Configuration();
            var charFormat:CharacterFormat = new CharacterFormat();
            var paraFormat:ParagraphFormat = new ParagraphFormat();
            charFormat.color = 0x000000;
            charFormat.fontFamily = "Arial, Helvetica, _sans";
            charFormat.fontSize = 12;
            charFormat.kerning = Kerning.ON;
            charFormat.fontStyle = FontPosture.NORMAL;
            paraFormat.textAlign = TextAlign.LEFT;
            paraFormat.direction = Direction.RTL;
            config.textFlowInitialCharacterFormat = charFormat;
            config.textFlowInitialParagraphFormat = paraFormat;
            textFlow = new TextFlow(config);

            var p:ParagraphElement = new ParagraphElement();
            var span:SpanElement = new SpanElement();
            span.text = _Value;
            p.addChild(span);
            textFlow.addChild(p);

            textFlow.flowComposer.addController(new DisplayObjectContainerController(this,130,16));
             textFlow.flowComposer.updateAllContainers();

           textFlow.interactionManager = new EditManager();

/////////////////////////////////////////////////////////////////////////////////////////////////////////

It's OK, but when I change

           paraFormat.textAlign = TextAlign.LEFT;


to

           paraFormat.textAlign = TextAlign.RIGHT;

the textflow becomes not editable and doesn't show text.

This topic has been closed for replies.

1 reply

Adobe Employee
April 7, 2009

I'm not sure why this wouldn't work, if all you are doing is replacing the "paraFormat.textAlign = TextAlign.LEFT" with  "paraFormat.textAlign = TextAlign.RIGHT". Sometime after you've done this, and before you click on the text, you have to have called updateAllContainers() to refresh the display.

However, if you are using TLF with Flex, it is possible to get a more recent version of TLF. The one posted on Labs dates back to last November. There are fresh SWCs posted with the Flex Gumbo Open Source release; if you get these, that is the most up to date code. You will need to build the documentation so you can follow the API changes, and it might be helpful also to view the TLF blog. If you have questions feel free to post them here.