Skip to main content
Known Participant
April 14, 2010
Answered

How can I detect when the last container in my flow is full?

  • April 14, 2010
  • 1 reply
  • 881 views

I have a bunch of linked containers which I am flowing text through. How can I detect when the text has filled a container? there's an overflowPolicy so I assume this can be detected.

This topic has been closed for replies.
Correct answer Jacques TRIPOZ

Hi,

I used this :

private function IsOverset(textFlow:TextFlow):Boolean

{

var zeComposer:IFlowComposer=textFlow.flowComposer;

var iTextLen:int=textFlow.textLength;

var iNoController:int=zeComposer.findControllerIndexAtPosition(iTextLen - 1);

return (iNoController == -1);

}

HTH,

J.

1 reply

Jacques TRIPOZCorrect answer
Inspiring
April 14, 2010

Hi,

I used this :

private function IsOverset(textFlow:TextFlow):Boolean

{

var zeComposer:IFlowComposer=textFlow.flowComposer;

var iTextLen:int=textFlow.textLength;

var iNoController:int=zeComposer.findControllerIndexAtPosition(iTextLen - 1);

return (iNoController == -1);

}

HTH,

J.

PoobeardAuthor
Known Participant
April 14, 2010

Hey! That might just work! thanks for your response.

:-)

PoobeardAuthor
Known Participant
April 14, 2010

short lived I'm afraid. I only ever get -1 with this ...

var containerIndex:int = textFlow.flowComposer.findControllerIndexAtPosition(textFlow.textLength);
                    if(containerIndex==-1) textFlowCompleteHandler();

I'm detecting this as the flow is created. The textFlow.length is being set correctly.

Any ideas?