Skip to main content
Participant
December 8, 2010
Question

Determining if the amount of text exceeds the available width

  • December 8, 2010
  • 1 reply
  • 549 views

Hello,

So I've created a TextFlow input field using

textFlow.interactionManager = new EditManager();

I've also limited the vertical scrolling to using controller.verticalScrollPolicy = ScrollPolicy.OFF;

so basically I have just one input line.

The controller also has a fixed width, so when a user starts typing and the amount of text exceeds the available viewing space the newly entered text is no longer visible.

What I'm after is a method to 'read' the total textWidth and compare that to the width of the textFlow container so I can do something when the space runs out. Is this at all possible?

Many thanks for any thoughts

cheers

This topic has been closed for replies.

1 reply

Adobe Employee
December 8, 2010

The ContainerController has a content bounds (see getContentBounds). You could check the content bounds to see how wide the text is.

Do you want the text to wrap at the container edge? If not, you could consider setting compositionWidth to NaN.

Hope this helps,

- robin

FlashertAuthor
Participant
December 10, 2010

Hi Rob

Thanks very much! I'll give it a try and post the results later

cheers

elvin