Detect paragraphs with the TextLayout framework
If you want to detect how many paragarphs are contained into an XML flow you can simpy use the power of E4X and the default namespace directive of ActionScript 3.0.
var data:XML = <TextFlow cffHinting="horizontalStem" color="#000000" columnCount="inherit" columnGap="inherit" columnWidth="inherit"
fontFamily="Verdana" fontLookup="embeddedCFF" fontSize="26" lineBreak="inherit" paddingBottom="15" paddingLeft="15"
paddingRight="15" paddingTop="15" renderingMode="cff" verticalAlign="inherit"
whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">
<p>
<span>
Enter your text here...
</span>
</p>
<p>
<span>
Enter your text here...
</span>
</p>
</TextFlow>;
var textFlowNamespace:Namespace = new Namespace("http://ns.adobe.com/textLayout/2008");
default xml namespace = textFlowNamespace;
trace(data.p.length())




