Skip to main content
Participant
April 19, 2010
Question

Auto resize width height in TextFlow controller

  • April 19, 2010
  • 1 reply
  • 2415 views

HI,

We are facing the problem in auto resize width height in TextFlow controller. Content is overlaping withing the controller or sometimes it's seems like not full containt displaying on the control.

We are writing the below code in the flashx.textLayout.events.CompositionCompleteEvent listiner to orgnize the above step:

     var controller:ContainerController = new ContainerController();

     textFlow.flowComposer.composeToPosition();
     var contentBounds:Rectangle = _controller.getContentBounds();
           
   _controller.setCompositionSize(_controller.compositionWidth, contentBounds.height);
   textFlow.flowComposer.addController(_controller);
   textFlow.flowComposer.updateAllControllers();

Please correct if are missing any steps above.

Regards,

R.BS

This topic has been closed for replies.

1 reply

R_BSAuthor
Participant
April 22, 2010

Hi,

I have got the solution on my last query. Below is the code to get rid of the content display and auto adjust the width & height of the controller:

var textHeight:int = Math.ceil(_controller.getContentBounds().height);
                  
   if (textHeight > _controller.compositionHeight) {
     TextDataHeight = textHeight + 12;
 
               _controller.setCompositionSize(TextDataWidth ,TextDataHeight);
              
               textFlow.flowComposer.updateAllControllers();
              }

I have also set the TextDataHeight = 50 to display complete paragraph text.

Due to this I have one problem arise that is indentation of the paragraph content or bulleted text on my content.

Is any one have the solution on this?

Looking forward for your response.

Regards,

R.BS

stoem
Known Participant
February 6, 2012

I think my issue is related to this - have a look and see if it helps:

http://forums.adobe.com/message/4188141#4188141

Regards,

Stefan