Skip to main content
Participating Frequently
September 16, 2009
Question

TLF scrollPolicy

  • September 16, 2009
  • 1 reply
  • 1022 views

Hi Guys,

talking about the verticalScrollPolicy,

I had a movie where I used TLF component for Flash CS4, in this movie I used this code to enable vertical scroll:

---------------------------------------------------

tt=new TextLayout;

tt.verticalScrollPolicy="on";

this.addChild(tt);

---------------------------------------------------

Now I'm working with the textLayout.SWC from Flex SDK and I have problems to enable verticalScroll:

---------------------------------------------------

oTextFlow = new TextFlow();

oTextFlow = TextFilter.importToFlow(oXML, TextFilter.TEXT_LAYOUT_FORMAT);

oTextFlow.flowComposer.addController(new ContainerController(this, oWidth, oHeight));
oTextFlow.flowComposer.getControllerAt(0).verticalScrollPolicy = ScrollPolicy.ON;
oTextFlow.flowComposer.getControllerAt(0).setCompositionSize(oWidth, oHeight);
oTextFlow.flowComposer.compose();

oTextFlow.flowComposer.updateAllControllers();

--------------------------------------------------

When the height of textFlow is to small to contain the text the vertical scroll doesn't appear....

Can someone help me? thank you...

This topic has been closed for replies.

1 reply

Participating Frequently
September 16, 2009

Try

oTextFlow.interactionManager = new SelectionManager();

or

oTextFlow.interactionManager = new EditManager();

But, vertical scroll bar will not appear because verticalScrollPolicy is just a policy that allows you to scroll. So, you need to create it by yourself.

Yoshiki Okawa

llnnAuthor
Participating Frequently
September 18, 2009

Sorry,

I'm sure does not depent on that.... when I use verticalScrollPolicy=on in TLF component for Flash CS4 it works and generates scrollbar...

Participating Frequently
September 18, 2009

Sorry for misunderstanding of your problem.

I have created my custom scrollbar which synchronizes with ContainerController.horizontalScrollPosition, and it works perfectly.

So, if you are working with a custom made scrollbar, check if TextFlow.flowComposer.composeToPosition() is called before getting an actual size of your text field by ContainerController.getContentBounds().

If not, please tell us which scrollbar you are using and, if possible, post your codes.

Yoshiki Okawa