Linked Containers problem
Hi,
I'm trying to have text flowing in multiple containers. Those container are created in ActionsScript. When a new RichEditableText is created, I'm doing this:
public function addTextContainerl(newText:RichEditableText):void
{
var newPageController:ContainerController = new ContainerController( newText );
newPageController.setCompositionSize( newText.width, newText.height);
var firstControllerFormat:TextLayoutFormat = new TextLayoutFormat();
firstControllerFormat.paddingTop = 4;
firstControllerFormat.paddingRight = 4;
firstControllerFormat.paddingBottom = 4;
firstControllerFormat.paddingLeft = 4;
newPageController.format = firstControllerFormat;
textFlow.flowComposer.addController(newPageController);
// Draw the text, and make it editable
textFlow.flowComposer.updateAllControllers();
textFlow.interactionManager = new EditManager();
}
Before that, when the application is initialized, I do:
textFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
textFlow.flowComposer = new StandardFlowComposer();
textFlow is a private var, and markup is a string with some formatted text.
It works ok (the text renders and flows), but if I click on one of the RichEditableText one of two things happen:
1. The text disapears.
2. I got this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.edit::SelectionManager$/computeSelectionIndexInContainer()
Any ideas?
