Skip to main content
Vikram_S
Known Participant
January 25, 2011
Question

Justification with last line center

  • January 25, 2011
  • 1 reply
  • 315 views

Hello all,

I am using textLayout_1.0.0.595.swf.

I have problem with setting justification with last line center style to paragraph .

Here is code snippet

var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat(null);

textLayoutFormat.textAlign = TextAlign.JUSTIFY;
textLayoutFormat.textAlignLast=TextAlign.CENTER;

var editManager:EditManager = currentSelectedTextFlow.interactionManager as EditManager;

editManager.applyFormat(textLayoutFormat,textLayoutFormat,null);

Thanks,

Vikram

This topic has been closed for replies.

1 reply

Adobe Employee
January 25, 2011

I would suggest that you simplify your code slightly and just call applyParagraphFormat, since the change you are making is to the paragraph.

When you call applyParagraphFormat, it will apply the format based on the current selection. If you add this line:

     currentSelectedTextFlow.interactionManager.selectRange(0, 0);

Then the format should be applied to the first paragraph. To see what the selection is, you can look at the interactionManager's absoluteStart and absoluteEnd. Values of -1 means there is no selection and no changes will be applied.

Hope this helps,

- robin