When the user makes a operation, (eg.: Change size of the component, change size of the font, write, change font) i have a damage handler to make some fix on the text and for that i need to acces line by line, this line are on the flow composer.
The normal beahaviour is when i change the size of the font, write something or change the size of the component i can have access to the standadFlowComposer and everything works as expected.
protected function textFlow_damageHandler(event:DamageEvent):void
But when i select a font sometimes my flow composer goes null so as you can see on the code above i was trying to set a flowcomposer but and i try to access the lines they are always null.
for (var i:int=0; i<len; i++)
tfl = this.textFlow.flowComposer.getLineAt(i);
trace("LINE IS NULL");
By the traces i found out that the standarflwocomposer is changed for a TCMFactoryDisplayComposer
and after that i get null every where and lot of errors on the component.
So here comes a litle description of the code, as i said i use embebed fonts, and this is the event handler when the font is loaded from the server and registed on flex i setted the font family to the component.
protected function fontLoaded_completeHandler( event : FDFontEvent ) : void
if (event==null ||
!event.data is FDFontData ||
(event.data as FDFontData).fontName != fontFamily ||
richEditableText.getStyle("fontFamily")==(event.data as FDFontData).className
fontLoaded = true;
richEditableText.setStyle( "fontFamily", (event.data as FDFontData).className );
Thank you for the reply, i hope that someone have a idea!
Kudos points for him!!!!