Skip to main content
daslicht
Known Participant
June 11, 2010
Answered

Adding Colums

  • June 11, 2010
  • 1 reply
  • 632 views

Hi,

I have a Component with a RichEditable text and I want to display the text in two colums.

I found this example code here:

private function changeColumnCount(newCount:String):void

{      if (_textFlow && _textFlow.interactionManager is IEditManager)      {      var cf:TextLayoutFormat = new TextLayoutFormat();          cf.columnCount = newCount;          IEditManager(_textFlow.interactionManager).applyContainerFormat(cf);          _textFlow.interactionManager.setFocus();      }      }

When I try to apply it to my RichEditableText.textFlow nothing happens.

Even the if condition is not true?

I tried it like this:

private function changeColumnCount(newCount:String):void {      if (myEditor.textFlow && myEditor.textFlow.interactionManager is IEditManager)      {           var cf:TextLayoutFormat = new TextLayoutFormat();           cf.columnCount = newCount;           IEditManager(_editor.textFlow.interactionManager).applyContainerFormat(cf);           myEditor.textFlow.interactionManager.setFocus();      } }

What do I miss?

Is there somewhere a simple Flex4 example for a 2 Colum Rich Editable Text?

This topic has been closed for replies.
Correct answer

I'd have to look a bit more into the RichEditableText implementation to see why the code above isn't working, but can you use the column count style information built into the component?

myEditor.setStyle ("columnCount", newCount);

1 reply

Correct answer
June 11, 2010

I'd have to look a bit more into the RichEditableText implementation to see why the code above isn't working, but can you use the column count style information built into the component?

myEditor.setStyle ("columnCount", newCount);

daslicht
daslichtAuthor
Known Participant
June 14, 2010

Hello Alan,

that"s funny, I havent even looked it up since I thought way to complicated since I knew that there is a colum feature in the TLF.

But its even more simple than setting a style:

<s:RichEditableText id="_editor"                  columnCount="2"/>

Thank you very much !

Marc