Skip to main content
Participant
April 15, 2011
Question

TextFlow into multiple RichEditableText containers keeping container styles

  • April 15, 2011
  • 1 reply
  • 1027 views

I'm stumped.

Can  anyone help me to flow text into multiple RichEditableText contianers  with different styles applied to each container?  When I use the  following code, it works for flowing text between the containers but it  does not adopt the styles of the RichEditableText objects that I attach.

var textFlow:TextFlow;

textFlow  = TextConverter.importToFlow("one two three four five six seven eight  nine ten eleven twelve thirteen", TextConverter.PLAIN_TEXT_FORMAT);

textFlow.flowComposer.addController(new ContainerController(richTextEditor1, richTextEditor1.width, richTextEditor1.height));

textFlow.flowComposer.addController(new ContainerController(richTextEditor2, richTextEditor2.width, richTextEditor2.height));

textFlow.flowComposer.updateAllControllers();

I  have tried to apply styles directly to the ContainerControllers with no  success.  I can apply a style to the TextFlow but it uses that style  for the all containers where the text is flowing into.

If I  attach the textFlow object directly to the textFlow property in the  RichEditableText object, it will keep the formatting of the  RichEditableText.  But then I can't figure out how to make it flow to  the next text box.

I even tried adding the additional  controller (attached to the second RichEditableText) to the TextFlow  after attaching it to the first RichEditableText object.  No luck.

I hope this is a stupid qustion and there is a simple answer.  Any help is appreciated.

Thank you!

Mike

This topic has been closed for replies.

1 reply

Adobe Employee
April 17, 2011

I think it's a good question. I have not tried to do this before and cannot get a quick and simple idea either.

Let's wait for expert's answer.

April 17, 2011

Unfortunately it is a good question and there isn't a simple answer.

The RichEditableText component was not built with multiple containers in mind, so you'll run into problems trying to use it in a multiple container context.

It sounds like you've figured out how to run the text through multiple containers directly from ActionScript, which does work well. You can then attach an EditManager to make the text editable. And as the documentation states, you can use the format object on the ContainerController to change container-level formatting (like columns). But if I'm understanding you correctly, you're trying to get the text to change something like fontSize or fontStyle as it flows between containers. That's not something TLF supports yet, and it's not a simple feature to add (either in TLF or your own code).