Skip to main content
Mar 5, 2009 6:12 AM UTC
Answered

Retain Old Container columnCount and columnGap Properties

Hi,

I have a textFlow where I have implemented columnCount and columnGap properties.
Now for some reason I have to remove that old container with:

textFlow.flowComposer.removeAllControllers();

and use a new container to update it's height and width;

But I am not getting the columnCount and columnGap even though I reassign it with ContainerFormat after adding the Controller to textFlow.

Please suggest.

Thanks
Rajesh
This topic is closed to new replies. Start a new post to keep the conversation going.
rdermerCorrect answer
Inspiring
Mar 6, 2009 5:29 PM UTC
Hi Rajesh,

Using setCompositionSize is the best way to do it - it's intended for resizing.

In your original code (ported to 370) you could have done this.

Before the removeAllControllers:
var format:ITextLayoutFormat = textFlow.flowComposer.getContainerControllerAt(0).textLayoutFormat;

And then after creating _container
_container.textLayoutFormat.textLayoutFormat = format;

In any case what you are doing now is much better for resizing.

Richard

5 replies

rdermerCorrect answer
Inspiring
Mar 6, 2009 5:29 PM UTC
Hi Rajesh,

Using setCompositionSize is the best way to do it - it's intended for resizing.

In your original code (ported to 370) you could have done this.

Before the removeAllControllers:
var format:ITextLayoutFormat = textFlow.flowComposer.getContainerControllerAt(0).textLayoutFormat;

And then after creating _container
_container.textLayoutFormat.textLayoutFormat = format;

In any case what you are doing now is much better for resizing.

Richard
Translate
Adobe Employee
Mar 6, 2009 5:29 PM UTC
Yes, this is the right answer. You don't have to replace the container if all you need is a resize.
Translate
Inspiring
Mar 5, 2009 5:17 PM UTC
Please update to build 370 - if you're still using ContainerFormat you're version is significantly out of date. A sample of your problem would be helpful - that works in our testing bug something else may be going on.
Translate
Mar 6, 2009 7:33 AM UTC
Hi,

As per your suggestion I have updated the TLF version to 370.
Now what I am trying is: My textflow container is of some width and height given when we create it as.

_container = new DisplayObjectContainerController(sprite, this.width, this.height);

after adding this to textFlow, I want it to resize when user does some operation on it, like enter some words or characters. I need to resize my textFlow as per the user input width or height.
so I was trying below:

textFlow.flowComposer.removeAllControllers();
_container = new DisplayObjectContainerController(sprite, this.width, resizeTextHeight);
textFlow.flowComposer.addController(_container);
textFlow.flowComposer.updateAllContainers();

i.e. I need to remove previous container and add new one as per the new height and width.
But if i have already done some formatting on the container like columnCount or columnGap, I will have to inherit those properties to the new container as well. But creating new container removes all the previous formatting applied to the previous container.

Please suggest how I can do this.

Regards,
Rajesh
Translate
Mar 6, 2009 8:57 AM UTC
Hi rdermer,

I have used below code:

_container.setCompositionSize(this.width, resizeTextHeight);

and it seems like it is working now.
please confirm if this is the right way to implement.

Regards,
Rajesh
Translate