CompositionHeight issues
Hi,
I have a container that resizes when the user modifies its content. This textflow may contain text and images. I need to find a way to measure the total height required to display its content. I have read several post here and have tried several solutions without luck.
I'm waiting to the CompositionCompleteEvent event and then trying to figure out of the container needs to be resized:
protected function compositionCompleteHandler(event:CompositionCompleteEvent):void
{
var containerIndex:int = event.textFlow.flowComposer.findControllerIndexAtPosition( event.textFlow.textLength-1 );
if(containerIndex == -1){
// resize the component!!!!!
var boundaries:Rectangle = (textFlow.flowComposer.getControllerAt(0) as ContainerController).getContentBounds();
textFlow.flowComposer.composeToPosition();
boundaries = (textFlow.flowComposer.getControllerAt(0) as ContainerController).getContentBounds(); // boundaries.height outputs the same value, no change
}
}
The weird thing is tha after doing composeToPosition(), there is no change.
Also, if in the second line of the text, there is an image, the bounds don't use the space used by the image to calculate the bounds. why???
Any ideas?
