Hi there,
First of all - I'm quite new to the whole TLF so maybe this question is just plain stupid. I want to read all of the atoms of a textFlow to parse it into SVG.
I saw some quite good topics around here, so parsing is not the problem. I'm trying the following:
var flow:TextFlow = element.textFlow; //element is a RichText instance
var num:uint = flow.numChildren;
for(var i:uint = 0; i<num; i++){
var child:FlowElement = flow.getChildAt(0);
// Find out the position on screen
var elementStart:int = child.getAbsoluteStart();
var textFlowLine:TextFlowLine = flow.flowComposer.findLineAtPosition(elementStart);
var lineStart:int = textFlowLine.absoluteStart;
var linkStartInLine:int = elementStart - lineStart;
var tl:TextLine = textFlowLine.getTextLine(true);
var rect:Rectangle = tl.getAtomBounds(linkStartInLine);
trace(rect);
}
The line that is highlighted breaks, this happens because the textFlow has no flowComposer. I digged into the framework and saw that TextFlowTextLineFactory is being used, specifically the method
createTextLines does the following:
textFlow.changeFlowComposer(null,false);
which nulls the flowComposer.
So my question is how do I get the RichText class to stop nulling my flowComposer everytime I set the textFlow Object? Or what is the right way to assign a flowComposer to a textFlow of a RichText?
North America
Europe, Middle East and Africa
Asia Pacific