Skip to main content
March 5, 2009
Answered

Retain Old Container columnCount and columnGap Properties

  • March 5, 2009
  • 3 replies
  • 752 views
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 has been closed for replies.
Correct answer rdermer
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

3 replies

rdermerCorrect answer
Adobe Employee
March 6, 2009
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
Adobe Employee
March 6, 2009
Yes, this is the right answer. You don't have to replace the container if all you need is a resize.
Adobe Employee
March 5, 2009
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.
March 6, 2009
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
March 6, 2009
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