When I add an EditManager to the example i see a problem for what my customer wants...
package
{
import flash.display.Sprite;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.container.ScrollPolicy;
import flashx.textLayout.edit.EditManager;
public class Test extends Sprite
{
public function Test()
{
var cs1:Sprite = new Sprite();
addChild(cs1);
var cs2:Sprite = new Sprite();
addChild(cs2);
cs2.x = 100;
cs2.y = 100;
var tekstLayoutFormat:TextLayoutFormat = new TextLayoutFormat()
var textFlow:TextFlow = new TextFlow();
textFlow.format = tekstLayoutFormat;
var em:EditManager;
em = new EditManager();
textFlow.interactionManager = em;
var cc1:ContainerController = new ContainerController(cs1, 80, 80);
cc1.verticalScrollPolicy = ScrollPolicy.OFF;
cc1.horizontalScrollPolicy = ScrollPolicy.OFF;
var cc2:ContainerController = new ContainerController(cs2, 80, 80);
cc2.verticalScrollPolicy = ScrollPolicy.OFF;
cc2.horizontalScrollPolicy = ScrollPolicy.OFF;
textFlow.flowComposer.addController(cc1);
textFlow.flowComposer.addController(cc2);
var paragraphElement:ParagraphElement = new ParagraphElement();
paragraphElement.columnBreakAfter = "always";
var spanElement:SpanElement = new SpanElement();
spanElement.text = "Chapter 1.\nBla bla.";
spanElement.fontSize = 10;
paragraphElement.addChild(spanElement);
var paragraphElement2:ParagraphElement = new ParagraphElement();
var spanElement2:SpanElement = new SpanElement();
spanElement2.text = "Chapter 2.\nBla bla.";
spanElement2.fontSize = 10;
paragraphElement2.addChild(spanElement2);
textFlow.addChild(paragraphElement);
textFlow.addChild(paragraphElement2);
textFlow.flowComposer.updateAllControllers();
}
}
}
Now if you want to edit chapter 1; for instance you type a sentence before the "Bla bla." and press enter, all content after the enter seems to be pushed into a new ParagraphElement (with paragraphElement.columnBreakAfter = "always") and jumps to the next container... and chapter 2 also gets pushed to a new container (which isn't around) so we don't see Chapter 2 anymore...
At the very beginning when we implement the breaks feature, we do consider the specific character as a potential solution. But we found it will bring a lot of logic conflicts with the W3C's attribute definition. As TLF need to support the import/export from/to html, we decide to use the attribute solution. Personally, I don't think there will be a specific character version breaks in the recent future.
About the issue you mentioned about your customer, Seems it can be solved by using the containerBreakBefore/columnBreakBefore attribute for the paragraph next to your paragraph which got content. Am I right?